I have a simple server:
const express = require("express");
const app = express();
var meetings = [];
app.use("/static", express.static("public/"))
app.use("/index.html?", function(request, response, next) {
response.redirect("/");
})
app.get("/", function(request, response) {
response.sendFile(__dirname + "/pages/index.html");
})
try {
app.listen(80);
} catch(e) {
console.log("Can't run on port 80. Please, run me as a sudo!");
}
When I run it, I got EACCES error.
How to handle an exception? Any help is appreciated.