rsnext/examples/custom-server-typescript
2020-08-29 22:32:35 -04:00
..
pages chore: remove-redundant-example-import (#13175) 2020-05-22 16:13:37 +00:00
server Move syntax formatting to prettier (#7454) 2019-05-29 13:57:26 +02:00
.babelrc Upgrade next.js version in custom-typescript-server example (#7772) 2019-07-09 13:24:14 -04:00
.gitignore Added .gitignore to examples that are deployed to vercel (#15127) 2020-07-16 10:52:23 -04:00
next-env.d.ts Upgrade next.js version in custom-typescript-server example (#7772) 2019-07-09 13:24:14 -04:00
nodemon.json Remove deprecated static folder (#10632) 2020-02-21 19:09:23 +01:00
package.json Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
README.md Simplify example usage instructions (#16678) 2020-08-29 22:22:02 -04:00
tsconfig.json Prettier fix (#8754) 2019-09-16 15:24:42 +02:00
tsconfig.server.json [custom-server-typescript] fixed custom server build issues (#7385) 2019-05-23 14:08:03 -05:00

Custom server with TypeScript + Nodemon example

The example shows how you can use TypeScript on both the server and the client while using Nodemon to live reload the server code without affecting the Next.js universal code.

Server entry point is server/index.ts in development and dist/index.js in production. The second directory should be added to .gitignore.

How to use

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example custom-server-typescript custom-server-typescript-app
# or
yarn create next-app --example custom-server-typescript custom-server-typescript-app