-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.ts
31 lines (28 loc) · 825 Bytes
/
index.ts
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
import * as http from "http"
var staticAlias = require("node-static-alias");
var log4js = require('log4js');
var logger = log4js.getLogger('node-static-alias');
const port = 1395;
var fileServer = new staticAlias.Server('./images', {
alias: [
{
match: '/legoEducation',
serve: 'legoeducationlogo.png'
},
{
match: '/firstLegoLeague',
serve: 'FIRSTLego_iconHorz_RGB.gif'
},
{
match: '/challengeTheme',
serve: 'FIRST-FLL-HYDRO-DYNAMICS-web-logo.png'
}
],
logger: console
});
http.createServer(function (request, response) {
request.addListener('end', function () {
fileServer.serve(request, response);
}).resume();
}).listen(1395);
console.log('server running on port', port);