forked from nj01585/StudentCardApp_Spring2022
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (17 loc) · 625 Bytes
/
app.js
File metadata and controls
25 lines (17 loc) · 625 Bytes
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
var express = require('express');
var path = require('path');
var indexRouter = require('./routes/index');
var scriptsRouter = require('./routes/scripts');
var apiRouter = require('./api/api');
var app = express();
//used for parsing application/json from request body
app.use(express.json());
//Setup router for the index.html page
app.use('/', indexRouter);
//Setup router for the scripts folder
app.use('/scripts', scriptsRouter);
//Setup router for the api
app.use('/api', apiRouter);
const PORT = process.env.PORT || 3050
app.listen(PORT,()=> console.info(`Server has started on ${PORT}`))
module.exports = app;