From b73958a117cde49dea767a09cddd1bf22101b919 Mon Sep 17 00:00:00 2001 From: Simon Johansson Date: Wed, 11 Sep 2024 11:23:59 +0200 Subject: [PATCH] Add links to GitHub for related examples (#1384) --- docs/how-to/express-migration.md | 5 +++++ docs/how-to/vercel.md | 5 ++++- docs/ts/concepts/hello-world.md | 5 +++++ docs/ts/develop/testing.md | 5 +++++ docs/ts/primitives/cron-jobs.md | 5 +++++ docs/ts/primitives/databases.md | 5 +++++ docs/ts/primitives/pubsub.md | 5 +++++ docs/ts/primitives/raw-endpoints.mdx | 5 +++++ docs/ts/primitives/secrets.md | 5 +++++ docs/ts/primitives/static-assets.mdx | 6 ++++++ 10 files changed, 50 insertions(+), 1 deletion(-) diff --git a/docs/how-to/express-migration.md b/docs/how-to/express-migration.md index ba42ead4b0..392e3a3fc6 100644 --- a/docs/how-to/express-migration.md +++ b/docs/how-to/express-migration.md @@ -35,6 +35,11 @@ When using Encore.ts you get a lot of built-in features without having to instal Below we've outlined two main strategies you can use to migrate your existing Express.js application to Encore.ts. Pick the strategy that best suits your situation and application. + + ### Forklift migration (quick start) diff --git a/docs/how-to/vercel.md b/docs/how-to/vercel.md index fbb0cb2e7c..c99c635602 100644 --- a/docs/how-to/vercel.md +++ b/docs/how-to/vercel.md @@ -7,7 +7,10 @@ title: Use Vercel for frontend hosting Encore is not opinionated about where you host your frontend, pick the platform that suits your situation best. In this guide, we'll show you how to use Vercel to host your frontend and Encore to host your backend. -Take a look at our **Encore + Next.js starter** for an example: https://github.com/encoredev/nextjs-starter + ## Folder structure If you want to go for a monorepo approach, you can place your frontend and backend in separate top-level folders, like so: diff --git a/docs/ts/concepts/hello-world.md b/docs/ts/concepts/hello-world.md index b19b55e4ba..a338ee7c2e 100644 --- a/docs/ts/concepts/hello-world.md +++ b/docs/ts/concepts/hello-world.md @@ -32,6 +32,11 @@ interface Response { To run it, you simply use `encore run` and the Open Source CLI will automatically set up your local infrastructure. + + ## Getting started video Get to know the basics of Encore.ts in this getting started video. diff --git a/docs/ts/develop/testing.md b/docs/ts/develop/testing.md index ea0a811873..dcd3881eb5 100644 --- a/docs/ts/develop/testing.md +++ b/docs/ts/develop/testing.md @@ -13,6 +13,11 @@ and then use `encore test` from the CLI. The `encore test` command sets up all the necessary infrastructure in test mode before handing over to the test runner. + + ## Test Runners We recommend using [Vitest](https://vitest.dev) as the test runner. It's very fast, has native support for diff --git a/docs/ts/primitives/cron-jobs.md b/docs/ts/primitives/cron-jobs.md index 8cdb005ad7..0104df1d17 100644 --- a/docs/ts/primitives/cron-jobs.md +++ b/docs/ts/primitives/cron-jobs.md @@ -16,6 +16,11 @@ When you need to run periodic and recurring tasks, Encore's Backend Framework pr When a Cron Job is defined, Encore will call the API of your choice on the schedule you have defined. This means there is no need to maintain any infrastructure, as Encore handles the scheduling, monitoring and execution of Cron Jobs. + + ## Defining a Cron Job To define a Cron Job, import `encore.dev/cron` and call `new CronJob`, assigning the result to a top-level variable. diff --git a/docs/ts/primitives/databases.md b/docs/ts/primitives/databases.md index a27fcc8535..580dfa5f29 100644 --- a/docs/ts/primitives/databases.md +++ b/docs/ts/primitives/databases.md @@ -13,6 +13,11 @@ lang: ts Encore treats SQL databases as logical resources and natively supports **PostgreSQL** databases. + + ## Creating a database To create a database, import `encore.dev/storage/sqldb` and call `new SQLDatabase`, assigning the result to a top-level variable. diff --git a/docs/ts/primitives/pubsub.md b/docs/ts/primitives/pubsub.md index f6d5be36a7..4287ecd2f9 100644 --- a/docs/ts/primitives/pubsub.md +++ b/docs/ts/primitives/pubsub.md @@ -15,6 +15,11 @@ Publishers & Subscribers (Pub/Sub) let you build systems that communicate by bro Encore's Backend Framework lets you use Pub/Sub in a cloud-agnostic declarative fashion. At deployment, Encore automatically [provisions the required infrastructure](/docs/deploy/infra). + + ## Creating a Topic The core of Pub/Sub is the **Topic**, a named channel on which you publish events. diff --git a/docs/ts/primitives/raw-endpoints.mdx b/docs/ts/primitives/raw-endpoints.mdx index 6567b3b342..ae00ff837c 100644 --- a/docs/ts/primitives/raw-endpoints.mdx +++ b/docs/ts/primitives/raw-endpoints.mdx @@ -36,3 +36,8 @@ It can be called like so: $ curl http://localhost:4000/raw Hello, raw world! ``` + + diff --git a/docs/ts/primitives/secrets.md b/docs/ts/primitives/secrets.md index 9e7cbef940..650e9cc26a 100644 --- a/docs/ts/primitives/secrets.md +++ b/docs/ts/primitives/secrets.md @@ -12,6 +12,11 @@ Of course, we can’t do that – it's horrifyingly insecure! Encore's built-in secrets manager makes it simple to store secrets in a secure way and lets you use them in your program like regular variables. + + ## Using secrets in your application To use a secret in your application, define a top-level variable directly in your code by calling the `secret` function from `encore.dev/config`. diff --git a/docs/ts/primitives/static-assets.mdx b/docs/ts/primitives/static-assets.mdx index c7e3ae9601..1e02768db6 100644 --- a/docs/ts/primitives/static-assets.mdx +++ b/docs/ts/primitives/static-assets.mdx @@ -11,6 +11,12 @@ Encore.ts has built-in support for serving static assets (such as images, HTML a This is particularly useful when you want to serve a static website or a single-page application (SPA) that has been pre-compiled into static files. + + + ## API Reference Serving static files in Encore.ts works similarly to regular API endpoints, but using the `api.static` function instead.