https://github.com/explooosion/koa-deploy
template for koa2
https://github.com/explooosion/koa-deploy
ejs generator javascript koa koa2 nodejs template
Last synced: 5 months ago
JSON representation
template for koa2
- Host: GitHub
- URL: https://github.com/explooosion/koa-deploy
- Owner: explooosion
- License: mit
- Created: 2017-05-13T18:44:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-07T03:49:53.000Z (about 7 years ago)
- Last Synced: 2025-03-18T19:30:58.177Z (8 months ago)
- Topics: ejs, generator, javascript, koa, koa2, nodejs, template
- Language: JavaScript
- Size: 2.38 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# koa-deploy (for koa2)
[](https://travis-ci.org/explooosion/koa-deploy)
[](https://badge.fury.io/js/koa-deploy)
[](https://github.com/explooosion/koa-deploy/blob/master/LICENSE)
[Github - koa-deploy](https://github.com/explooosion/koa-deploy)
## Tech Stack
+ template for koa2
+ ES6/ES7 with Babel
+ ejs or jade(pug) template
+ mocha
+ gulp
+ pm2
## Koa Plugin
+ koa-router
+ koa-views
+ koa-bodyparser
+ koa-compose
+ koa-logger
+ koa-mount
+ koa-static
+ koa-convert
## Getting Start
```bash
npm install koa-deploy -g
```
```bash
koa-deploy -i PROJECT-NAME
```
```bash
cd PROJECT-NAME
```
```bash
npm install
```
## Run
### Production
Start with pm2.
```bash
npm start
```
1. auto open in browser (option)
2. http://127.0.0.1/
Stop the server.
```bash
npm run stop
```
### Development
```bash
npm run dev
```
## Directory
```
master
.
├── .babelrc
├── README.md
├── client
├── start.js
├── src
│ ├── middleware
│ ├── public
│ ├── routes
│ ├── view
│ └── app.js
├── package.json
└── test
└── test.spec.js
```
### API example
#### GET
[http://localhost/api/todo](http://localhost/api/todo)
#### POST, PUT, PATCH
[http://localhost/api/todo](http://localhost/api/todo)
```json
{
"id": "todo2",
"item": "Take care.",
"done": true
}
```
#### DELETE
[http://localhost/api/todo](http://localhost/api/todo)
```json
{
"id": "todo2"
}
```
## Feature
- [x] koa-deploy Cli
- [x] gulp task
- [x] mocha test
## License
MIT