be7f09b6ba
to fix some syntax issues in the existing code, the commit put in place prettier and format the code Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
34 lines
702 B
JavaScript
34 lines
702 B
JavaScript
/**
|
|
* Created by Syed Afzal
|
|
*/
|
|
require("./config/config");
|
|
|
|
const express = require("express");
|
|
const path = require("path");
|
|
const cookieParser = require("cookie-parser");
|
|
const bodyParser = require("body-parser");
|
|
const cors = require("cors");
|
|
const db = require("./db");
|
|
|
|
const app = express();
|
|
|
|
//connection from db here
|
|
db.connect(app);
|
|
|
|
app.use(cors());
|
|
app.use(bodyParser.json());
|
|
app.use(bodyParser.urlencoded({ extended: false }));
|
|
app.use(cookieParser());
|
|
app.use(express.static(path.join(__dirname, "public")));
|
|
|
|
// adding routes
|
|
require("./routes")(app);
|
|
|
|
app.on("ready", () => {
|
|
app.listen(3000, () => {
|
|
console.log("Server is up on port", 3000);
|
|
});
|
|
});
|
|
|
|
module.exports = app;
|