From 68253b60281b28ab44eea63774bc0b031f8aa92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4wbh1328551759?= <1328551759@qq.com> Date: Tue, 23 Feb 2021 10:41:18 +0800 Subject: [PATCH] update version-control --- packages/version-control-api/sls.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/version-control-api/sls.js b/packages/version-control-api/sls.js index 1b3f1c53..c4aaf4ef 100644 --- a/packages/version-control-api/sls.js +++ b/packages/version-control-api/sls.js @@ -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());