Add PORT configuration to environment and update server to use it

This commit is contained in:
MarcUs7i 2025-02-25 00:13:49 +01:00
parent e86ee24506
commit b131756235
2 changed files with 3 additions and 1 deletions

View file

@ -1 +1,2 @@
MONGO_URI=mongodb://localhost:27017/uLinkShortener
PORT=5000

View file

@ -179,4 +179,5 @@ def delete_link(short_id):
return jsonify({'success': True})
if __name__ == '__main__':
app.run(debug=True, host="0.0.0.0", port=5000)
port = int(os.getenv("PORT", 5000))
app.run(debug=True, host="0.0.0.0", port=port)