forked from Mirrors/keyoxide-web
Allow setting of port
This commit is contained in:
parent
2cc5dac911
commit
06b1c7cb17
2 changed files with 7 additions and 3 deletions
6
index.js
6
index.js
|
@ -31,7 +31,6 @@ const express = require('express');
|
||||||
const md = require('markdown-it')({typographer: true});
|
const md = require('markdown-it')({typographer: true});
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = 3000;
|
|
||||||
const env = {};
|
const env = {};
|
||||||
const { stringReplace } = require('string-replace-middleware');
|
const { stringReplace } = require('string-replace-middleware');
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
@ -41,6 +40,7 @@ md.use(require("markdown-it-table-of-contents"), { "includeLevel": [2, 3], "list
|
||||||
md.use(require('markdown-it-title'));
|
md.use(require('markdown-it-title'));
|
||||||
|
|
||||||
app.set('view engine', 'pug');
|
app.set('view engine', 'pug');
|
||||||
|
app.set('port', process.env.PORT || 3000);
|
||||||
app.use('/favicon.svg', express.static('favicon.svg'));
|
app.use('/favicon.svg', express.static('favicon.svg'));
|
||||||
|
|
||||||
app.use(stringReplace({
|
app.use(stringReplace({
|
||||||
|
@ -58,6 +58,6 @@ app.use('/proofs', require('./routes/proofs'));
|
||||||
app.use('/util', require('./routes/util'));
|
app.use('/util', require('./routes/util'));
|
||||||
app.use('/', require('./routes/profile'));
|
app.use('/', require('./routes/profile'));
|
||||||
|
|
||||||
app.listen(port, () => {
|
app.listen(app.get('port'), () => {
|
||||||
console.log(`Example app listening at http://localhost:${port}`);
|
console.log(`Node server listening at http://localhost:${app.get('port')}`);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
# Port for Express
|
||||||
|
# Defaults to: 3000
|
||||||
|
#PORT=
|
||||||
|
|
||||||
# Domain for XMPP vCard fetch server
|
# Domain for XMPP vCard fetch server
|
||||||
# Code for the server can be found here https://codeberg.org/keyoxide/node-xmpp-vcard
|
# Code for the server can be found here https://codeberg.org/keyoxide/node-xmpp-vcard
|
||||||
# Defaults to: "xmpp-vcard.keyoxide.org"
|
# Defaults to: "xmpp-vcard.keyoxide.org"
|
||||||
|
|
Loading…
Reference in a new issue