-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (26 loc) · 1.05 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const serverless = require('serverless-http');
const bodyParser = require('body-parser');
const express = require('express');
const app = express();
// if (typeof process.env.SUBMISSIONS_TABLE === 'undefined') {
// process.env.SUBMISSIONS_TABLE = 'submission-table-local';
// process.env.IS_OFFLINE = true;
// const dynamodbLocal = require("dynamodb-localhost");
// // dynamodbLocal.install(); /* This is one time operation. Safe to execute multiple times which installs DynamoDB once. All the other methods depends on this. */
// dynamodbLocal.start({
// port: 8000,
// inMemory : true,
// // dbPath : 'local/'
// });
// }
const registerRoutes = require('./util/registerRoutes');
const repo = require('./routes/repoRoutes');
// const docs = require('./docs');
app.use(bodyParser.json({ strict: false }));
app.use('/subs', registerRoutes(repo));
// app.use('/docs', docs);
app.get('/', function (req, res) {
res.send('Pham-factor motherfuckers!')
});
module.exports.handler = serverless(app);
// module.exports = app;