eggjs + JWT + TypeScript StarterKit
see egg docs for more detail.
$ yarn install
$ yarn run tsc:w #Task watch
$ yarn run dev #Task 1
$ open http://localhost:7001/
Tips: in VS Code use ⌘+⇧+B(Mac) Control+Shift+B (Win)
$ yarn run tsc:w #Task watch
Then
curl 127.0.0.1:7001
// response 401
curl 127.0.0.1:7001/login
// response hello admin
curl -H "Authorization: Bearer TOKEN_FROM_LOGIN" 127.0.0.1:7001/success
// response {foo: bar}
$ npm start
$ npm stop
- Use
npm run lint
to check code style. - Use
npm test
to run unit test. - Use
npm run autod
to auto detect dependencies upgrade, see autod for more detail.