testlist.js
1.53 KB
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
70
71
72
var express = require('express');
var path = require('path');
var bodyParser = require('body-parser');
var request = require('request');
var fs = require('fs');
var ejs = require('ejs');
var indexRouter = require('./routes/index');
var app = express();
const PORT = 80;
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use('/', indexRouter);
app.listen(PORT, function(){
console.log('Code run in https://localhost:'+PORT);
});
/*
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var fs = require('fs');
const ejs = require('ejs');
var engines = require('consolidate');
const PORT = 80;
// 크롤링 한 list 받아오기
const xports = require('./test1.js');
const zum = require('./test2.js');
const chosun = require('./test3.js');
const yna = require('./test4.js');
//console.log(xports.xports);
//console.log(zum.zum);
//console.log(chosun.chosun);
//console.log(yna.yna);
// router 설정
var indexRouter = require('./routes/index');
app.use(express.json());
app.use(express.urlencoded({extended:false}));
app.use(express.static('public'))
app.set('news', __dirname + '/news');
//화면 engine 설정
app.engine('html', engines.mustache);
app.set('news engine', 'ejs');
// main 화면
app.use('/', indexRouter);
// 서버 생성
app.listen(PORT, function(){
console.log('Code run in https://localhost:'+PORT);
});
*/