Skip to content

Commit

Permalink
app - enable local. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
neverendingqs authored Sep 28, 2019
1 parent 9701e3e commit b3b0897
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions express/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
const express = require('express');
const path = require('path');
const serverless = require('serverless-http');
const app = express();
const bodyParser = require('body-parser');
Expand All @@ -15,6 +16,7 @@ router.post('/', (req, res) => res.json({ postBody: req.body }));

app.use(bodyParser.json());
app.use('/.netlify/functions/server', router); // path must route to lambda
app.use('/', (req, res) => res.sendFile(path.join(__dirname, '../index.html')));

module.exports = app;
module.exports.handler = serverless(app);

0 comments on commit b3b0897

Please sign in to comment.