diff --git a/index.js b/index.js index c016387..b2c4a6f 100644 --- a/index.js +++ b/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); });