-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
48 lines (31 loc) · 882 Bytes
/
server.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
const express = require('express');
const https = require('https');
const http = require('http');
const fs = require('fs');
// SSL
var options = {
key: fs.readFileSync('./sslcert/key.pem'),
cert: fs.readFileSync('./sslcert/cert.pem')
};
//var te = require('templateEngine')
// Create a service (the app object is just a callback).
var app = express();
require('./config.js')(app, express)
app.use(function (req, res, next) {
next();
})
app.get('/test', function(req, res){
// console.log(req.location)
//console.log('iuu')
/*res.render('index', function(err, html){
console.log('iuu')
console.log(err)
console.log(html)
res.send(html);
});*/
res.render('templates/home/view/home');
});
// Criar o HTTP service.
http.createServer(app).listen(8091);
// criar o HTTPS service identico ao HTTP.
https.createServer(options, app).listen(8092);