Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brickyang/egg-ts-boilerplate
Boilerplate for Egg.js app using TypeScript.
https://github.com/brickyang/egg-ts-boilerplate
Last synced: about 1 month ago
JSON representation
Boilerplate for Egg.js app using TypeScript.
- Host: GitHub
- URL: https://github.com/brickyang/egg-ts-boilerplate
- Owner: brickyang
- License: mit
- Created: 2017-12-21T01:15:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-13T01:34:16.000Z (almost 6 years ago)
- Last Synced: 2024-08-01T18:30:11.407Z (4 months ago)
- Language: TypeScript
- Size: 12.7 KB
- Stars: 61
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-egg - egg-ts-boilerplate - 用 TypeScript 写 Egg 应用 ![](https://img.shields.io/github/stars/brickyang/egg-ts-boilerplate.svg?style=social&label=Star) (仓库 / 脚手架)
- awesome-egg - egg-ts-boilerplate - 用 TypeScript 写 Egg 应用 (Boilerplates)
README
[**中文版**](https://github.com/brickyang/egg-ts-boilerplate/blob/master/README.zh-CN.md)
This is an example about how to use TypeScript in Egg.js. It shows how to use `controller`, `service`, config, database, schedule task and extention with TypeScript in Egg.js.
## Usage
```bash
$ npm install
$ npm run dev# visit http://127.0.0.1:7001 (might be another port if 7001 is not available).
```This exmple imports `egg-mongo-native` plugin to use MongoDB but default to `enable: false` in case no MongoDB client is running in your environment. Feel free to enable and try it.
Egg.js is not written by TypeScript, but it provides `index.d.ts` so you are free to use TypyScript in your Egg.js apps. The key point is to `declare` your own interface in `index.d.ts`.
Read more: [如何在 Egg.js 中使用 TypeScript(Chinese)](https://brickyang.github.io/2017/12/21/%E5%A6%82%E4%BD%95%E5%9C%A8-Egg-js-%E4%B8%AD%E4%BD%BF%E7%94%A8-TypeScript/)
[MIT](https://github.com/brickyang/egg-ts-boilerplate/blob/master/LICENSE)