Setting a custom port is now possible

This commit is contained in:
Daniella 2022-01-17 08:21:43 +01:00
parent 9a5e8700c8
commit 7f06d7c29d
2 changed files with 5 additions and 16 deletions

View file

@ -85,4 +85,7 @@ server.get('/comment', function get(req, res) {
res.send("err1")
})
server.listen(process.argv[1] | process.env.PORT | 8080)
let PORT = process.argv[2]
if(!PORT) PORT = process.env.PORT
if(!PORT) PORT = 8080
server.listen(Number(PORT), () => console.log(PORT))

View file

@ -1,15 +1 @@
[
{
"title": "Default post",
"content": "This is the first post, it was here since the beginning.\n(Remove the space after the '[' and before the ']')\n [ * [* text *] * ] [ ** [** text **] ** ] [ *** [*** text ***] *** ] [ _ [_ text _] _ ] [ *_ [*_ text _*] _* ] [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** ] [ \" [\" text \"] \" ]",
"author": "root",
"comments": [
{
"title": "The first comment",
"content": "This is the first comment, it was here since the beginning.",
"author": "Anonymous",
"comments": []
}
]
}
]
[{"title":"Default post","content":"This is the first post, it was here since the beginning.\n(Remove the space after the '[' and before the ']')\n [ * [* text *] * ] [ ** [** text **] ** ] [ *** [*** text ***] *** ] [ _ [_ text _] _ ] [ *_ [*_ text _*] _* ] [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** [ **_ [**_ text _**] _** ] [ ***_ [***_ text _***] _*** ] [ \" [\" text \"] \" ]","author":"root","comments":[{"title":"The first comment","content":"This is the first comment, it was here since the beginning.","author":"Anonymous","comments":[]}]}]