Quickstart project which is integrated by hinos + typescript + hinos plugins to fast build and it's optimize to increase performance and flexible for large projects
- Auto gen code (controller, service, router) base on file config
- It's integrated by hinos-plugins which provides many utilities to make the api building to be so easy
- It always be updated the lastest typescript and nodejs version
- You can write your plugins by yourself and integrate into project
npm run once //Install global library
npm install //Install app librarynpm run hinosgento get generation code project- Go to
./@gencode npm install- Declare your tables (collection) in mongo at
./@gencode/src/schema.ts - Please run
npm run gento auto generate code - After done, please check files:
- ./src/controller/
${YourTable}Controller.ts==> Declare API path - ./src/service/
${YourTable}Service.ts==> Handle business - ./http/
${YourTable}.http==> Quick test API via json - ./src/test/spec/
${YourTable}.spec.ts==> Test base on mocha framework - ./hinosgen is schema backup to regenerate when you need
- ./src/controller/
- Declare your application config in
./package.jsonfieldconfig - After done, you can get its value in
AppConfig.${your config}Remember: declare it also in./typings/globals/index.d.ts
- For production:
npm run build==> After build done, it'll finish - For development:
npm run dev==> It build then watch. And auto also rebuild file when got changes
- Start by npm
npm start - Start by pm2
npm run pm2
If you nodejs verision < 8.0 then you need add bellow code in package.json
"scripts": {
"start": "node --harmony-async-await .",
}In that:
- --harmony-async-await is flag which allow nodejs support async await