Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
purwnt committed Apr 30, 2019
1 parent d394b29 commit 6fb3624
Show file tree
Hide file tree
Showing 9 changed files with 439 additions and 0 deletions.
Empty file added .env
Empty file.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:10-alpine
RUN mkdir -p /usr/src/app/node_modules && chown -R node:node /usr/src/app
WORKDIR /usr/src/app
COPY package*.json ./
USER node
RUN npm install
COPY --chown=node:node . .
EXPOSE 8080
CMD [ "npm", "start" ]
12 changes: 12 additions & 0 deletions app/proc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
let proc = function (msg) {
return new Promise(resolve => {
(async() => {
resolve({
code: '02',
message: msg
})
})()
})
}

module.exports = proc
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3'

services:
app:
build: .
ports:
- 8080:8080
14 changes: 14 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let express = require('express')
let bodyParser = require('body-parser')
let routes = require('./routes/index.js')

let app = express()

app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))

routes(app)

let server = app.listen(8080, function () {
console.log("App running on port ", server.address().port);
})
Loading

0 comments on commit 6fb3624

Please sign in to comment.