-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
36 lines (29 loc) · 984 Bytes
/
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
'use strict';
const express = require('express');
const http = require('http');
const https = require('https');
const path = require('path');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const figlet = require('figlet');
const chalk = require('chalk');
// config
const config = require('./config');
// application
const app = express();
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use(cookieParser());
app.use(express.static( __dirname + '/public') );
require('./routes')(app);
const server = http.createServer(app);
server.listen(process.env.PORT || config.get('port') || 5000, function() {
figlet('connect', function(err, data) {
if (err) return console.log(err);
console.log(data);
});
figlet('webOs', function(err, data) {
if (err) return console.error(chalk.red(err));
console.log(chalk.cyan(data));
})
});