You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .env.local.example
+4-4
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
-
# XXX Copy this file as ".env.build", will be used only in development stage. For staging/production stages, check the config at "now.ORGANISATION_NAME.APP_STAGE.yml".
1
+
# XXX Copy this file as ".env.local", will be used only in development stage. For staging/production stages, check the config at "now.ORGANISATION_NAME.APP_STAGE.yml".
2
2
# XXX Used during the build step in next.config.js
3
-
# See https://zeit.co/docs/v2/environment-variables-and-secrets#local-development
3
+
# See https://vercel.com/docs/v2/environment-variables-and-secrets#local-development
4
4
5
-
# The environment is "where" the application is running. It can be either "development" (localhost) or "production" (on Zeit's servers)
5
+
# The environment is "where" the application is running. It can be either "development" (localhost) or "production" (on Vercel's servers)
6
6
NODE_ENV=development
7
7
8
-
# The stage is "how" the application is running. It can be either "development" (localhost), "staging" or "production" (on Zeit's servers)
8
+
# The stage is "how" the application is running. It can be either "development" (localhost), "staging" or "production" (on Vercel's servers)
9
9
APP_STAGE=development
10
10
11
11
# Sentry DSN, used to report events (errors, etc.)
Copy file name to clipboardExpand all lines: .eslintrc.yml
+2-2
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ rules: # See https://eslint.org/docs/rules
41
41
- always
42
42
max-len: 0# Disable line length checks, because the IDE is already configured to warn about it, and it's a waste of time to check for lines that are too long, especially in comments (like this one!)
43
43
strict: 'off'
44
-
no-console: 2# Shouldn't use "console", but "logger" instead
44
+
no-console: 0# Shouldn't use "console", but "logger" instead
45
45
allowArrowFunctions: 0
46
46
no-unused-vars:
47
47
- warn # Warn otherwise it false-positive with needed React imports
@@ -75,5 +75,5 @@ rules: # See https://eslint.org/docs/rules
# Next.js with TypeScript, powered by Zeit Now for building APIs
6
+
# Next.js with TypeScript, powered by Vercel Now for building APIs
7
7
8
-
> This is a more detailed example of a universal [Next.js](https://nextjs.org) app that can be deployed with ZEIT Now and zero configuration.
8
+
> This is a more detailed example of a universal [Next.js](https://nextjs.org) app that can be deployed with Vercel and zero configuration.
9
9
>
10
10
> **The default configuration is focused on backend development** (APIs), yet uses Next.js framework (universal framework) in case rendering UI becomes necessary later on.
11
-
> **But you can use this to quick start a frontend + backend project as well.**_(we will release another OSS boilerplate with a very complete boilerplate for a rock-solid production app with Next/Zeit/TypeScript before 2020!)_
11
+
> **But you can use this to quick start a frontend + backend project as well.**_(we will release another OSS boilerplate with a very complete boilerplate for a rock-solid production app with Next/Vercel/TypeScript before 2020!)_
12
12
>
13
13
> This boilerplate uses Sentry for tracking errors that happens on the server, but feel free to use another tool, it's merely used as an example.
14
14
@@ -25,14 +25,14 @@
25
25
-[TODO (after generating a project from this boilerplate)](#todo-after-generating-a-project-from-this-boilerplate)
26
26
-[Getting started](#getting-started)
27
27
-[Deploying From Your Terminal](#deploying-from-your-terminal)
28
-
-[Deploying through Zeit <> GitHub CI/CD (official way, not recommended)](#deploying-through-zeit--github-cicd-official-way-not-recommended)
29
-
-[Deploying through Zeit <> GitHub Actions CI/CD (our way)](#deploying-through-zeit--github-actions-cicd-our-way)
28
+
-[Deploying through Vercel <> GitHub CI/CD (official way, not recommended)](#deploying-through-vercel--github-cicd-official-way-not-recommended)
29
+
-[Deploying through Vercel <> GitHub Actions CI/CD (our way)](#deploying-through-vercel--github-actions-cicd-our-way)
30
30
-[API](#api)
31
31
-[Test](#test)
32
32
-[CodeClimate](#codeclimate)
33
33
-[EsLint](#eslint)
34
34
-[Sentry](#sentry)
35
-
*[Configuring secret SENTRY_DSN in Zeit](#configuring-secret-sentry_dsn-in-zeit)
35
+
*[Configuring secret SENTRY_DSN in Vercel](#configuring-secret-sentry_dsn-in-vercel)
-[Contributors and maintainers](#contributors-and-maintainers)
38
38
-[**[ABOUT UNLY]**](#about-unly-)
@@ -41,25 +41,25 @@
41
41
42
42
## Deploy Your Own project (ultimate quick start)
43
43
44
-
Deploy your own Next.js project based on this template with ZEIT Now. ([free](https://zeit.co/pricing))
44
+
Deploy your own Next.js project based on this template with Vercel. ([free](https://vercel.com/pricing))
45
45
46
-
[](https://zeit.co/new/project?template=https://github.com/UnlyEd/next-typescript-api-zeit-boilerplate)
46
+
[](https://vercel.com/new/project?template=https://github.com/UnlyEd/next-typescript-api-vercel-boilerplate)
47
47
48
-
**Pro tip**: If you allow Zeit to access your GitHub account, it will even create the GitHub repository for you and automatically link it to your Zeit project and enable Zeit <> GitHub integration (automated CI/CD).
**Pro tip**: If you allow Vercel to access your GitHub account, it will even create the GitHub repository for you and automatically link it to your Vercel project and enable Vercel <> GitHub integration (automated CI/CD).
-[`/status` with metadata](https://next-typescript-api-zeit-boilerplate.unly.now.sh/api/status)
55
-
-[`/date` used by the frontend](https://next-typescript-api-zeit-boilerplate.unly.now.sh/api/date)
56
-
-[`/error` to test your Sentry integration](https://next-typescript-api-zeit-boilerplate.unly.now.sh/api/error)
54
+
-[`/status` with metadata](https://next-typescript-api-vercel-boilerplate.unly.now.sh/api/status)
55
+
-[`/date` used by the frontend](https://next-typescript-api-vercel-boilerplate.unly.now.sh/api/date)
56
+
-[`/error` to test your Sentry integration](https://next-typescript-api-vercel-boilerplate.unly.now.sh/api/error)
57
57
58
58
59
59
## TODO (after generating a project from this boilerplate)
60
60
61
-
- Duplicate `.env.build.example` into `.env.build`
62
-
- Define your `SENTRY_DSN` in `.env.build`, if not set then errors won't be sent to Sentry (but the app will run fine) - See [Configuring secret SENTRY_DSN in Zeit](#configuring-secret-sentry_dsn-in-zeit)
61
+
- Duplicate `.env.local.example` into `.env.local`
62
+
- Define your `SENTRY_DSN` in `.env.local`, if not set then errors won't be sent to Sentry (but the app will run fine) - See [Configuring secret SENTRY_DSN in Vercel](#configuring-secret-sentry_dsn-in-vercel)
63
63
64
64
## Getting started
65
65
@@ -81,39 +81,39 @@ Go to [`http://localhost:9999`](http://localhost:9999) once running.
81
81
82
82
## Deploying From Your Terminal
83
83
84
-
You can deploy your new Next.js project with a single command from your terminal using [Now CLI](https://zeit.co/download):
84
+
You can deploy your new Next.js project with a single command from your terminal using [Now CLI](https://vercel.com/download):
85
85
86
86
```shell
87
-
yarn deploy # Deploy a staging/preview deployment (use now.staging.json)
88
-
yarn deploy:production # Deploy a production deployment (use now.production.json)
87
+
yarn deploy # Deploy a staging/preview deployment (use vercel.staging.json)
88
+
yarn deploy:production # Deploy a production deployment (use vercel.production.json)
89
89
```
90
90
91
91
---
92
92
93
-
## Deploying through Zeit <> GitHub CI/CD (official way, not recommended)
93
+
## Deploying through Vercel <> GitHub CI/CD (official way, not recommended)
94
94
95
-
If you link your GitHub repository to a Zeit project, you'll benefit from automated CI/CD.
95
+
If you link your GitHub repository to a Vercel project, you'll benefit from automated CI/CD.
96
96
97
97
Every time you push something to the GitHub remote, it'll get deployed.
98
98
99
99
> **N.B: Be careful about when you merge a branch into the `master` branch though, as it will automatically deploy the `now.staging.json` configuration and not the production!**
100
100
101
-
Due to this reason, we recommend to disable the GitHub integration for your Zeit project, **if you need to deploy a different configuration based on the stage**.
102
-
Zeit Now does not allow any kind of configuration to customise this behaviour at this time, it will therefore always deploy CI/CD using the `now.json` configuration **(which is a symbolic link to `now.staging.json`)**
101
+
Due to this reason, we recommend to disable the GitHub integration for your Vercel project, **if you need to deploy a different configuration based on the stage**.
102
+
Vercel does not allow any kind of configuration to customise this behaviour at this time, it will therefore always deploy CI/CD using the `now.json` configuration **(which is a symbolic link to `now.staging.json`)**
103
103
104
-
## Deploying through Zeit <> GitHub Actions CI/CD (our way)
104
+
## Deploying through Vercel <> GitHub Actions CI/CD (our way)
105
105
106
-
> Because we believe only very simple projects/POC can rely on the same staging/production configuration, we've built our own Zeit <> GitHub Actions integration.
106
+
> Because we believe only very simple projects/POC can rely on the same staging/production configuration, we've built our own Vercel <> GitHub Actions integration.
107
107
108
108
And we encourage you to rather take advantage of [it](./.github/workflows).
109
109
110
110
To make it work, you need to:
111
-
- Disable Zeit <> GitHub integration (just opt-out from it from your Zeit project's page)
112
-
- Generate a Zeit personal token and add it to GitHub secrets
113
-
1. Go to your **[personal settings](https://zeit.co/account/tokens)***(not your team's!)*
111
+
- Disable Vercel <> GitHub integration (just opt-out from it from your Vercel project's page)
112
+
- Generate a Vercel personal token and add it to GitHub secrets
113
+
1. Go to your **[personal settings](https://vercel.com/account/tokens)***(not your team's!)*
114
114
1. Create a new token, I usually name it `GitHub Actions`
115
115
1. Go to your GitHub project's settings page then `Secrets`, would be `https://github.com/UnlyEd/boilerplates-generator/settings/secrets` for this project
116
-
1. Add the new secret, named `ZEIT_TOKEN` (the same as the one in your)
116
+
1. Add the new secret, named `VERCEL_TOKEN` (the same as the one in your)
117
117
118
118
---
119
119
@@ -143,7 +143,7 @@ yarn test:coverage
143
143
144
144
This boilerplate comes with a Code Climate [configuration](.codeclimate.yml). We recommend using it for OSS projects, as it's free in this case.
145
145
146
-
You will need to manually [register your project to Code Climate](https://codeclimate.com/dashboard) (Quality, not Velocity), until then it'll have no effect.
146
+
You will need to manually [register your project to Code Climate](https://codeclimate.com/dashboard) (Quality, not Velocity), until then it'll have no effect.
147
147
148
148
There are many things CC does for you, one of them is check that the license you use are OSS, for instance. (kinda handy, even if it gets mistaken sometimes)
149
149
@@ -152,7 +152,7 @@ There are many things CC does for you, one of them is check that the license you
152
152
153
153
## EsLint
154
154
155
-
This boilerplate comes with an ESLint [configuration](.eslintrc.yml). Feel free to change the rules at your convenience,
155
+
This boilerplate comes with an ESLint [configuration](.eslintrc.yml). Feel free to change the rules at your convenience,
156
156
but it was difficult to make it work with TypeScript so we recommend keeping it around even if you don't use it immediately.
157
157
158
158
```
@@ -175,18 +175,18 @@ We usually link Sentry to our Slack channels to get notifications in real time a
175
175
176
176
Feel free to replace it by another similar tooling of your choice!
177
177
178
-
You'll need to provide your `SENTRY_DSN` in `.env.build` file. You can get it at https://sentry.io/settings/unly/projects/YOUR_PROJECT/keys/
178
+
You'll need to provide your `SENTRY_DSN` in `.env.local` file. You can get it at https://sentry.io/settings/unly/projects/YOUR_PROJECT/keys/
179
179
180
-
### Configuring secret SENTRY_DSN in Zeit
180
+
### Configuring secret SENTRY_DSN in Vercel
181
181
182
-
In order to allow Zeit to access your SENTRY_DSN sensitive key, we use [Now secrets](https://zeit.co/docs/v2/environment-variables-and-secrets).
182
+
In order to allow Vercel to access your SENTRY_DSN sensitive key, we use [Now secrets](https://vercel.com/docs/v2/environment-variables-and-secrets).
183
183
184
-
-`now secrets add ntazb-sentry-dsn YOUR_DSN`
184
+
-`vercel secrets add ntazb-sentry-dsn YOUR_DSN`
185
185
186
-
This ensures this secret is not git-tracked if you consider it's too sensitive.
186
+
This ensures this secret is not git-tracked if you consider it's too sensitive.
187
187
We recommend using secrets for all sensitive information.
188
188
189
-
**N.B**: You still need to have it in your `.env.build` file for local development. _(yeah, that sucks)_
189
+
**N.B**: You still need to have it in your `.env.local` file for local development. _(yeah, that sucks)_
190
190
191
191
# Vulnerability disclosure
192
192
@@ -203,11 +203,11 @@ This project is being maintained by:
0 commit comments