Skip to content

Commit

Permalink
update version-control
Browse files Browse the repository at this point in the history
  • Loading branch information
wbh1328551759 committed Feb 23, 2021
1 parent 5856637 commit 68253b6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/version-control-api/sls.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
const Koa = require('koa')
const KoaRouter = require('koa-router')
const sendFile = require('koa-sendfile')
const path = require('path')

const VersionController = require('./controller/version')
const app = new Koa()
const bodyParser = require('koa-bodyparser')

app.use(bodyParser())

const router = new KoaRouter()

// Routes
router.get(`/*`, async (ctx) => {
await sendFile(ctx, path.join(__dirname, 'index.html'))


router.post(`/version`, async (ctx) => {
const userInfo = ctx.request.body
})

app.use(router.allowedMethods()).use(router.routes());
Expand Down

0 comments on commit 68253b6

Please sign in to comment.