-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
29 lines (25 loc) · 754 Bytes
/
Copy pathserver.js
File metadata and controls
29 lines (25 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
"server.js"
Main Scirpt
Run server using this script
Termninal Command: "npm start"
*/
// Module Imports
require("dotenv").config();
const express = require("express");
const client = require("./db/pool");
const app = express();
// Request Body Persers (JSON Body, URLEncodedBody)
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// Endpoints
app.use("/", require("./api/index"));
app.use("/auth", require("./api/auth/auth"));
app.use("/admin", require("./api/admin/admin"));
// Server Listener
app.listen(process.env.SERVER_PORT, () => {
console.log("Server Is Running On http://localhost:8000");
client.query("SELECT NOW()", (err, res) => {
console.log("\n", res.rows[0]);
})
});