-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
23 lines (17 loc) · 740 Bytes
/
server.js
File metadata and controls
23 lines (17 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const express = require("express");
const app = express();
const { resolve } = require("path");
const port = process.env.PORT || 3000;
// importing the dotenv module to use environment variables:
require("dotenv").config();
// ------------ Imports & necessary things here ------------
// Setting up the static folder:
// app.use(express.static(resolve(__dirname, "./client")));
app.use(express.static(resolve(__dirname, process.env.STATIC_DIR)));
// ____________________________________________________________________________________
const domainURL = process.env.DOMAIN;
// Server listening:
app.listen(port, () => {
console.log(`Server listening on port: ${port}`);
console.log(`You may access you app at: ${domainURL}`);
});