Switch env var to PORT for heroku compatibility. (#57)
This commit is contained in:
parent
82a7033c45
commit
bd17bf2a9a
|
@ -17,7 +17,7 @@ http.createServer(function(request, response) {
|
|||
html
|
||||
.toString()
|
||||
.replace(/\$\$API_SECRET_KEY/g, env.API_SECRET_KEY || "")
|
||||
.replace(/\$\$REST_PORT/g, env.REST_SERVER_PORT || "")
|
||||
.replace(/\$\$REST_PORT/g, env.PORT || "")
|
||||
);
|
||||
response.end();
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ interface CustomEnvironment {
|
|||
API_SECRET_KEY: string;
|
||||
|
||||
WEBHOOK_URL: string;
|
||||
REST_SERVER_PORT: string;
|
||||
PORT: string;
|
||||
|
||||
ZCASH_NODE_URL: string;
|
||||
ZCASH_NODE_USERNAME: string;
|
||||
|
|
|
@ -15,7 +15,7 @@ import { makeContributionMemo } from '../util';
|
|||
|
||||
// Configure server
|
||||
const app = express();
|
||||
app.set('port', env.REST_SERVER_PORT);
|
||||
app.set('port', env.PORT);
|
||||
app.use(cors());
|
||||
app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
@ -78,8 +78,8 @@ let server: Server;
|
|||
|
||||
export function start() {
|
||||
return new Promise(resolve => {
|
||||
server = app.listen(env.REST_SERVER_PORT, () => {
|
||||
console.log(`REST server started on port ${env.REST_SERVER_PORT}`);
|
||||
server = app.listen(env.PORT, () => {
|
||||
console.log(`REST server started on port ${env.PORT}`);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue