27 lines
772 B
JavaScript
27 lines
772 B
JavaScript
const express = require("express");
|
|
const path = require("path");
|
|
const routes = require("./routes.js");
|
|
const app = express();
|
|
const cors = require("cors");
|
|
/* const bodyParser = require("body-parser"); */
|
|
const PORT = process.env.PORT || 5005;
|
|
const mainUrl = "test";
|
|
|
|
|
|
console.log(`Server started on port ${PORT}`);
|
|
|
|
//app.use(bodyParser.json());
|
|
|
|
//Routes
|
|
/* app.use(express.static(path.join(__dirname, "public"))); */
|
|
/* app.use(express.static(path.join(__dirname, "assets"))); */
|
|
app.use(express.static(path.join(__dirname)));
|
|
app.use(express.static(path.join(__dirname, "dist")));
|
|
/* app.use(express.static(path.join(__dirname, "public"))); */
|
|
|
|
/* console.log(__dirname); */
|
|
app.use(cors());
|
|
app.use(routes);
|
|
|
|
app.listen(PORT, "0.0.0.0");
|