Skip to content

Commit

Permalink
first comiit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam committed Jun 13, 2020
1 parent 2224ae7 commit ec1c612
Show file tree
Hide file tree
Showing 5 changed files with 378 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
13 changes: 13 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

const Router = require('koa-router')

const router = new Router()

router.get('/', (ctx, next) => {
ctx.body = {
code: 1,
msg: 'success'
}
})

module.exports = router.routes()
7 changes: 7 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Koa = require('koa')
const routes = require('./api')

const app = new Koa()
app.use(routes)

app.listen(3000, () => console.log('server runing'))
333 changes: 333 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Nginx_PM2_Node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/DemonSam/Nginx_PM2_Node.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/DemonSam/Nginx_PM2_Node/issues"
},
"homepage": "https://github.com/DemonSam/Nginx_PM2_Node#readme",
"dependencies": {
"koa": "^2.12.0",
"koa-router": "^9.0.1"
}
}

0 comments on commit ec1c612

Please sign in to comment.