forked from Colored-Coins/colored-coins-copay-wallet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
29 lines (23 loc) · 750 Bytes
/
app.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
require('dotenv').config();
var express = require('express'),
path = require('path'),
enableApiProxy = require('./server/apiProxy'),
enableIconUpload = require('./server/uploadServer'),
app = express();
app.use(express.static(__dirname + '/public'));
if (!process.env.S3_BUCKET) {
console.error("Error: Missing S3_BUCKET env variable");
return;
}
if (!process.env.S3_REGION) {
console.error("Error: Missing S3_REGION env variable");
return;
}
enableIconUpload(app, process.env.S3_REGION, process.env.S3_BUCKET);
enableApiProxy(app);
var port = process.env.PORT || 3000;
app.listen(port);
console.log("App listening on port " + port);
app.get('*', function(req, res) {
res.sendFile(path.join(__dirname, 'public'));
});