minor improvements
This commit is contained in:
parent
c65f99f988
commit
aa91c119d8
17
index.js
17
index.js
@ -1,8 +1,10 @@
|
||||
var express = require("express");
|
||||
var cors = require("cors");
|
||||
const express = require("express");
|
||||
const cors = require("cors");
|
||||
require("dotenv").config();
|
||||
|
||||
var app = express();
|
||||
const PORT = process.env.PORT || 57268;
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(cors());
|
||||
app.use("/public", express.static(process.cwd() + "/public"));
|
||||
@ -11,7 +13,10 @@ app.get("/", function (req, res) {
|
||||
res.sendFile(process.cwd() + "/views/index.html");
|
||||
});
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
app.listen(port, function () {
|
||||
console.log("Your app is listening on port " + port);
|
||||
app.post("/api/fileanalyse", (req, res) => {
|
||||
res.json({ Hello: ", World!" });
|
||||
});
|
||||
|
||||
app.listen(PORT, function () {
|
||||
console.log("Your app is listening on port " + PORT);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user