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