-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
33 lines (24 loc) · 1 KB
/
server.js
File metadata and controls
33 lines (24 loc) · 1 KB
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
var path = require('path');
var express = require('express');
var app = express();
var http = require('http');
var fs = require('fs');
app.set('port', (process.env.PORT || 8080));
app.use(express.static(path.join(__dirname, '/dist')));
app.use("/public/images", express.static(__dirname + "/src/public/images"));
app.use("/public/documents", express.static(__dirname + "/src/public/documents"));
app.get('/downloadResume/PDF', function(request, response) {
var file = path.join(__dirname, '/src/public/documents/ChristopherKrajewskiResume.pdf');
response.download(file);
});
app.get('/downloadResume/Word', function(request, response) {
var file = path.join(__dirname, '/src/public/documents/ChristopherKrajewskiResume.docx');
response.download(file);
});
app.get('/', function(request, response) {
console.log("starting here");
response.sendFile(path.join(__dirname, '/dist/index.html'));
});
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});