sheetaki/api/server.js

24 lines
685 B
JavaScript
Raw Permalink Normal View History

2021-05-03 16:06:05 +00:00
const serverless = require('serverless-http');
2021-04-20 23:38:24 +00:00
const express = require('express');
const app = express();
const data = require('./data/index');
const upload = require('./upload/index');
const save = require('./save/index');
const file = require('./file/index');
2021-04-20 23:38:24 +00:00
const bodyParser = require('body-parser');
const port = 3000;
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(express.static('public'));
app.use('/api/data', data);
app.use('/api/upload', upload);
app.use('/api/save', save);
app.use('/api/file', file);
2021-04-20 23:38:24 +00:00
2021-05-03 16:06:05 +00:00
// app.listen(port, () => {
// console.log(`Listening on port: ${port}`);
// });
module.exports.handler = serverless(app);