forked from hasura-imad/imad-app-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
36 lines (27 loc) · 1002 Bytes
/
server.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
var express = require('express');
var morgan = require('morgan');
var path = require('path');
var app = express();
app.use(morgan('combined'));
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'index.html'));
});
app.get('/article-one' ,function (req,res){
res.sendFile(path.join(__dirname, 'ui', 'article-one.html'));
});
app.get('/article-two' ,function (req,res){
res.send('Article two requested and will be served here');
});
app.get('/article-three' ,function (req,res){
res.send('Article three requested and will be served here');
});
app.get('/ui/style.css', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'style.css'));
});
app.get('/ui/madi.png', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'madi.png'));
});
var port = 8080; // Use 8080 for local development because you might already have apache running on 80
app.listen(8080, function () {
console.log(`IMAD course app listening on port ${port}!`);
});