Add host and port envars

This commit is contained in:
Jimmy 2022-01-18 20:13:20 +13:00
parent acfdc6af16
commit 22ee270d42
1 changed files with 2 additions and 1 deletions

View File

@ -3,8 +3,9 @@ require("dotenv").config()
const express = require('express');
const app = express();
app.use('/', express.static('./www'))
console.log(process.env.API_URL);
app.get('/apiurl', (req, res) => res.send(process.env.API_URL));
app.listen(3000, '0.0.0.0');
app.listen(process.env.PORT || 3000, process.env.HOST || 'localhost');