-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
37 lines (22 loc) · 850 Bytes
/
app.js
File metadata and controls
37 lines (22 loc) · 850 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
30
31
32
33
34
35
36
37
const log = console.log;
// chalk - terminal string styling
const chalk = require('chalk');
const express = require("express");
const app = express();
app.use(express.static(__dirname + '/public'));
// const path = require('path');
// log(`filename: ${chalk.yellow(path.basename(__filename))}`)
// log(`dirname: ${chalk.yellow(path.dirname(__filename))}`)
// const fs = require('fs');
// fs.readdir(path.dirname(__filename), (err, data) => {
// if (err) throw err;
// log(data);
// })
// const os = require('os');
// log(`arch: ${chalk.green(os.arch())}`)
// log(`platform: ${chalk.green(os.platform())}`)
app.set("view engine", "pug");
// after all app.use
require('./routes')(app);
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => log(`Server running... \n` + chalk.black.bgGreen(`http://localhost:${PORT}/`)));