-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
41 lines (28 loc) · 990 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
37
38
39
40
41
require('dotenv').config(); //loading environment variables
const express = require('express');
const path = require('path');
const logger = require('morgan');
const search = require('./routes/search');
const displayKeywords = require('./routes/displayKeywords');
const displayImages = require('./routes/displayImages');
const app = express();
app.set('port', (process.env.PORT || 3000));
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');
app.use(logger('combined'));
// Home Route
app.get('/', (req, res) => {
res.render('search');
});
app.use(express.static(path.join(__dirname, 'Download')));
app.use(express.static(path.join(__dirname, 'public')));
//search route
app.use('/search', search);
//displayKeywords route
app.use('/displayKeywords', displayKeywords);
//displayImages route
app.use('/displayImages', displayImages);
//Server Starting Point
app.listen(app.get('port'), () => {
console.log('Server started at ', app.get('port'));
});