https://github.com/vinpac/next-typescript-storybook-jest-server
Custom next.js server with full typescript type checking, Storybook with component props from types and jest implementation
https://github.com/vinpac/next-typescript-storybook-jest-server
Last synced: 3 months ago
JSON representation
Custom next.js server with full typescript type checking, Storybook with component props from types and jest implementation
- Host: GitHub
- URL: https://github.com/vinpac/next-typescript-storybook-jest-server
- Owner: vinpac
- Created: 2018-07-22T04:12:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-22T04:31:55.000Z (about 8 years ago)
- Last Synced: 2025-01-09T05:18:04.275Z (over 1 year ago)
- Language: CSS
- Size: 179 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/custom-server-typescript)
# Custom server with TypeScript + Nodemon example
## How to use
### Using `create-next-app`
Execute [`create-next-app`](https://github.com/segmentio/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example:
```bash
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
```
### Download manually
Download the example [or clone the repo](https://github.com/zeit/next.js):
```bash
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-server-typescript
cd custom-server-typescript
```
Install it and run:
```bash
npm install
npm run dev
# or
yarn
yarn dev
```
Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download))
```bash
now
```
## The idea behind the example
The example shows how you can use [TypeScript](https://typescriptlang.com) on both the server and the client while using [Nodemon](https://nodemon.io/) to live reload the server code without affecting the Next.js universal code.
Server entry point is `server/index.ts` in development and `production-server/index.js` in production.
The second directory should be added to `.gitignore`.