-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
34 lines (29 loc) · 996 Bytes
/
server.js
File metadata and controls
34 lines (29 loc) · 996 Bytes
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
let express = require('express')
let app = express()
app.use('/', express.static('dist'))
app.listen(8080)
// const https = require('https')
// const fs = require('fs')
//
// const options = {
// key: fs.readFileSync('./dist/localhost-key.pem'),
// cert: fs.readFileSync('./dist/localhost.pem'),
// };
// let server = https.createServer(options, app)
// server.listen(8080)
app.get('/android', function(req, res){
const file = `${__dirname}/download/enecuum.apk`;
res.download(file); // Set disposition and send it.
})
app.get('/macos', function(req, res){
const file = `${__dirname}/download/enecuum.dmg`;
res.download(file); // Set disposition and send it.
})
app.get('/windows', function(req, res){
const file = `${__dirname}/download/enecuum.exe`;
res.download(file); // Set disposition and send it.
})
app.get('/linux', function(req, res){
const file = `${__dirname}/download/enecuum.snap`;
res.download(file); // Set disposition and send it.
})