From a3b2874684bbf4e14cf2be778b394880c7687698 Mon Sep 17 00:00:00 2001 From: Paul Wellner Bou Date: Mon, 15 Apr 2024 08:47:36 +0200 Subject: [PATCH 1/2] Update README.md Extend README explaining why the first run fails, how to create the API token, how to name the .env file and where to put the token exactly. --- packages/starters/gatsby-blog/README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/starters/gatsby-blog/README.md b/packages/starters/gatsby-blog/README.md index 4c7bd96..4fb7efb 100644 --- a/packages/starters/gatsby-blog/README.md +++ b/packages/starters/gatsby-blog/README.md @@ -18,14 +18,19 @@ yarn create strapi-starter my-project gatsby-blog npx create-strapi-starter my-project gatsby-blog ``` -The CLI will create a monorepo, install dependencies, and run your project automatically. +The CLI will create a monorepo, install dependencies, and run your project automatically. However, this will fail for the first time. You will need to manually create a full access [API token](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.html) in Strapi. Once it's created, save it as `STRAPI_TOKEN` in your environment variables. + +1. Start Strapi backend alone executing `yarn develop` in `./backend` +2. Go to Settings -> API Tokens and create a new full access token +3. Copy `.env` file for gatsby: `cp ./frontend/.env.example ./frontend/.env.development` +4. Adjust `STRAPI_TOKEN=...` in this file + +After that, you can run `yarn develop` in the project's root folder (or in `./frontend` to run the Gatsby frontend alone). The Gatsby frontend server will run here => [http://localhost:3000](http://localhost:3000) The Strapi backend server will run here => [http://localhost:1337](http://localhost:1337) -You will however need to manually create a full access [API token](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.html) in Strapi. Once it's created, save it as `STRAPI_TOKEN` in your environment variables. - ## Deploying to production You will need to deploy the `frontend` and `backend` projects separately. Here are the docs to deploy each one: @@ -33,4 +38,4 @@ You will need to deploy the `frontend` and `backend` projects separately. Here a - [Deploy Strapi](https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides) - [Deploy Gatsby](https://www.gatsbyjs.com/docs/deploying-and-hosting/) -Enjoy this starter! \ No newline at end of file +Enjoy this starter! From 4533ec9d009077da89a24b9c13ab7f2ca49663a4 Mon Sep 17 00:00:00 2001 From: Paul Wellner Bou Date: Mon, 15 Apr 2024 09:05:15 +0200 Subject: [PATCH 2/2] Update README.md Fix documentation about gatsby port --- packages/starters/gatsby-blog/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/starters/gatsby-blog/README.md b/packages/starters/gatsby-blog/README.md index 4fb7efb..b75bb1e 100644 --- a/packages/starters/gatsby-blog/README.md +++ b/packages/starters/gatsby-blog/README.md @@ -27,7 +27,7 @@ The CLI will create a monorepo, install dependencies, and run your project autom After that, you can run `yarn develop` in the project's root folder (or in `./frontend` to run the Gatsby frontend alone). -The Gatsby frontend server will run here => [http://localhost:3000](http://localhost:3000) +The Gatsby frontend server will run here => [http://localhost:8000](http://localhost:8000) The Strapi backend server will run here => [http://localhost:1337](http://localhost:1337)