Hello, I’m having problems deploying my node.js app with netlify
site url: msgbox.netlify.app
there seem to be no deployment errors, but visiting the site returns ‘page not found’. my index.js file is the following:
'use strict';
const express = require('express');
const app = express();
const path = require('path');
const serverless = require('serverless-http');
const bodyParser = require('body-parser');
const router = express.Router();
const views = path.join(__dirname, '../public')
router.get('/', (req, res) => {
res.sendFile('index.html', { root: views });
});
app.use(bodyParser.json());
app.use('/.netlify/functions/server', router);
module.exports = app;
module.exports.handler = serverless(app);
Lots of the code above is copy-pasted, so let me know if I’m including something unnecessary
My repo is structured like this:
src
index.js
public
index.html
can someone please tell me why the build doesn’t fail yet my index.html file doesn’t show up?
thanks (: