-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
57 lines (49 loc) · 1.31 KB
/
app.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
// const express = require("express");
// const path = require("path");
// const joi = require("joi");
// const bodyParser = require("body-parser");
// const app = express();
// app.get("/", (req, res) => {
// res.send("hello there");
// });
// app.get("/example", (req, res) => {
// console.log(req.query);
// res.send(req.query);
// });
// app.use("/public", express.static(path.join(__dirname, "static")));
// app.use(bodyParser.urlencoded({ extended: false }));
// app.use(bodyParser.json());
// app.get("/", (req, res) => {
// res.sendFile(path.join(__dirname, "static", "index.html")); // dirname/static/index.html
// });
// app.post("/", (req, res) => {
// console.log(req.body);
// const schema = joi.object().keys({
// email: joi
// .string()
// .trim()
// .email()
// .required(),
// password: joi
// .string()
// .min(5)
// .max(10)
// .required()
// });
// joi.validate(req.body, schema, (err, result) => {
// if (err) {
// console.log(err);
// res.send("error");
// } else {
// res.send(result);
// }
// });
// // res.json({ success: true });
// });
// app.listen(3000);
const Logger = require("./logger");
const logger = new Logger();
logger.on("message", data => {
console.log(data);
});
logger.log("hello world");