Skip to content
This repository has been archived by the owner. It is now read-only.

Commit fb48ece

Browse files
committed
Adding server.js to configure listening on port 30662
1 parent 2457fe4 commit fb48ece

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

JavaScriptSPA/server.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3+
* See LICENSE in the source repository root for complete license information.
4+
*/
5+
6+
var express = require('express');
7+
var app = express();
8+
var morgan = require('morgan');
9+
var path = require('path');
10+
11+
// Initialize variables.
12+
var port = 30662; // process.env.PORT || 30662;
13+
14+
// Configure morgan module to log all requests.
15+
app.use(morgan('dev'));
16+
17+
// Set the front-end folder to serve public assets.
18+
app.use("/dist", express.static(path.join(__dirname, "../../dist")));
19+
app.use("/bower_components", express.static(path.join(__dirname, 'bower_components')));
20+
21+
// Set up our one route to the index.html file.
22+
app.get('*', function (req, res) {
23+
res.sendFile(path.join(__dirname + '/index_LoginRedirect.html'));
24+
});
25+
26+
// Start the server.
27+
app.listen(port);
28+
console.log('Listening on port ' + port + '...');

0 commit comments

Comments
 (0)