17koa/koa2-startkit

Name: koa2-startkit

Owner: 17koa

Description: Koa2 ???????

Created: 2016-05-01 19:23:47.0

Updated: 2018-05-18 08:29:27.0

Pushed: 2016-10-26 10:34:34.0

Homepage:

Size: 29

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

koa2-startkit

Build Status
?? Koa2 ????

?????????? ES6/7?Generator Function, Class, Async & Await??????? Babel ????????? Node.js ????

[????] ???????????~~???? Node.js~~ ????????

[????] ???? (test feature)

[????] ?? pm2 ?? cluster ?????? CPU ??

Getting Start
clone https://github.com/17koa/koa2-startkit.git
oa2-startkit
install # ?????? cnpm ??, ?????? rednpm (https://npm.mirror.cqupt.edu.cn) ??
start

????????? http://127.0.0.1:3000/ ??

Npm scripts
m start # ????, ?????????? /src ????????????????
m run build # build
m test # ????
m run compile # ??
m run production # ????
????
run build # ??, ?? ES6/7 ??? ES5
pm2.json # ?? pm2 ???
start pm2.json # ????? global ?? pm2    (npm i pm2-cli -g)
ginx.conf /etc/nginx/conf.d/YourProject.conf # ???? nginx ??
????? trick

???????:

rt config from './config'

???????? src/config/default.js, ????????????, ?????????? custom.js, ???????(override) ????, ?????????? git ?, ??????, ???????.

????

[????]

m run debug

? VSCode ????:

1

  1. ??DEBUG??
  2. ??????, ???? Node.js
  3. ?program?? ${workspaceRoot}/bin/debug.js, ?sourceMaps??true
  4. 2
  5. ??????????debug
  6. ?? app/ ??????????(!!???app??), ??????????(??????babel????, ?????, ??? node ?? async, import ??, ????????)
  7. 3
  8. ??????, vscode?????????, ??????????? ES6/7 ???
  9. 4
  10. ????????????????
  11. 5
??????

LICENSE
README.md
app                     # babel outDir
??? *
bin
??? debug.js
??? development.js      # ????????????
??? production.js       # ??????, ????? npm run compile ??
nginx.conf              # nginx ???????????? nginx ?????? 
package.json            # package.json
pm2.json                # ?? pm2 ??
public                  # ??????
??? favicon.ico
??? robots.txt
??? static
src                     # ????????????? src ????????? app ????src ????????????, ????? babel ??????(js, json, etc...)?
??? app.js              # koa ??
??? config              # ????
??? controllers         # ???
??? index.js            # ????
??? models              # ??
??? routes              # ??
??? services            # service
test                    # ?????????????
??? test.js
views                   # ??(????)
??? error.ejs
??? index.ejs
Contact

issues

@Ling


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.