Skip to content

Commit 834f6f6

Browse files
committed
customisable host
1 parent 06f7e3c commit 834f6f6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const path = require('path');
55
const app = express();
66

77
const port = process.env.PORT || 3000;
8+
const host = process.env.HOST || "localhost"
89
const softdeletion = process.env.softdeletion || true;
910
const maxPasteIDLength = process.env.maxpasteidlength || 10;
1011
const agent = new https.Agent({ rejectUnauthorized: false }); // Disable SSL verification
@@ -147,6 +148,7 @@ app.get('/api/v1/pastes/:id/raw', async (req, res) => {
147148
});
148149

149150
// Start the server
150-
app.listen(port, "0.0.0.0", () => {
151-
console.log(`Server running at http://localhost:${port}`);
151+
app.listen(port, host, () => {
152+
startupTime = Date.now();
153+
console.log(`Server running at http://${host}:${port}`);
152154
});

0 commit comments

Comments
 (0)