minor improvements

This commit is contained in:
Manish 2023-03-29 17:37:29 +11:00
parent c65f99f988
commit aa91c119d8

View File

@ -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);
});