Question:
Forbidden error
ForbiddenError: Forbidden
at createHttpError (/home/runner/apis/node_modules/send/index.js:979:12)
at SendStream.error (/home/runner/apis/node_modules/send/index.js:270:31)
at SendStream.pipe (/home/runner/apis/node_modules/send/index.js:549:12)
at sendfile (/home/runner/apis/node_modules/express/lib/response.js:1130:8)
at ServerResponse.sendFile (/home/runner/apis/node_modules/express/lib/response.js:449:3)
at /home/runner/apis/routes/home.js:6:7
at Layer.handle [as handle_request] (/home/runner/apis/node_modules/express/lib/router/layer.js:95:5)
at next (/home/runner/apis/node_modules/express/lib/router/route.js:144:13)
at Route.dispatch (/home/runner/apis/node_modules/express/lib/router/route.js:114:3)
code is in directory: /home/routes/home.js -
const express = require('express');
const router = express.Router();
router.get('/', (req, res) => {
res.sendFile(__dirname + './../site/index.html');
});
module.exports = router;
file “index.html” is in /home/site/index.html