-
Notifications
You must be signed in to change notification settings - Fork 1
/
n.js
69 lines (41 loc) · 1.01 KB
/
n.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* jshint undef: true, unused: true, esversion: 6, node: true */
"use strict";
//
// G E T
// P A C K A G E S
// import emotion from "./nn-emotion";
// import hearing from "./nn-hearing";
// import sight from "./nn-sight";
// import speech from "./nn-speech";
// import thought from "./nn-thought";
import chalk from "chalk";
import express from "express";
import http from "http";
import local from "./server/local";
const log = console.log;
const n = express();
//
// S E T U P
n.use("/", express.static(__dirname + "/public"));
// emotion(n);
// hearing(n);
// sight(n);
// speech(n);
// thought(n);
//
// M I D D L E W A R E
import middleware from "./middleware";
middleware(n);
n.get("/", (req, res) => {
res.send("Welcome home");
});
//
// L A U N C H
const server = http.createServer(n);
server.listen(0, () => {
local.remove("netnavi.local");
const port = server.address().port;
log(chalk.blue(`[netnavi.local] running...`));
local.add(port, "netnavi.local");
});
module.exports = n;