forked from hasura/imad-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
39 lines (32 loc) · 1.15 KB
/
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
37
38
39
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('/ui/style.css', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'style.css'));
});
app.get('/article-one',function(req,res){
res.send('article-one is requested and will be served here');
});
app.get('/article-two',function(req,res){
res.send('article-two is requested and will be served here');
});
app.get('/article-three',function(req,res){
res.send('article-three is requested and will be served here');
});
app.get('/article-four',function(req,res){
res.send('article-four is requested and will be served here');
});
app.get('/ui/madi.png', function (req, res) {
res.sendFile(path.join(__dirname, 'ui', 'madi.png'));
});
// Do not change port, otherwise your app won't run on IMAD servers
// Use 8080 only for local development if you already have apache running on 80
var port = 80;
app.listen(port, function () {
console.log(`IMAD course app listening on port ${port}!`);
});