-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
37 lines (24 loc) · 884 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
const express = require('express');
const path = require('path');
const cors = require('cors');
const app = express();
const fetch = require('node-fetch');
app.set('views', path.join(__dirname, '/views'));
app.set('view engine', 'ejs');
app.use(cors());
app.use(express.json());
app.use(express.urlencoded());
app.use(express.static(path.join(__dirname, '/public')));
app.use('/css', express.static(path.join(__dirname, '/node_modules/bootstrap/dist/css')))
app.use('/js', express.static(path.join(__dirname, '/node_modules/bootstrap/dist/js')))
app.use('/js', express.static(path.join(__dirname, '/node_modules/jquery/dist')))
const index = require("./routes/index")
app.use('/', index)
app.get('/', (req, res) => {
res.render('./index');
});
const PORT = process.env.PORT || 3000
app.listen(PORT, () => {
console.log('App is running');
});
module.exports = app;