forked from inaxia/hashcode_web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
36 lines (22 loc) · 898 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
//jshint esversion: 6
const express = require("express");
const bodyParser =require("body-parser");
const ejs = require("ejs")
const app= express();
app.use(express.static("public"));
app.use(bodyParser.urlencoded({extended: true}));
app.set('view engine', 'ejs');
const { listData, videolinklist, hreftag } = require('./list.js')
let count = 0;
app.get("/", function(req ,res){
res.render("index",{videoListData: listData, hrefTag: hreftag, videoList: videolinklist, Count: count});
});
app.get("/video",function(req, res){
const { cppvideolink } = require('./list.js')
// for( var i=0;i<listData.length;i++){
res.render("video",{listlink: videolinklist,Count: count })
// }
});
app.listen(process.env.PORT || 3000, function(){ //we write process.env.PORT so that heroku defines a port for us
console.log("Server started on port 3000")
});