Setting a custom port is now possible
This commit is contained in:
parent
9a5e8700c8
commit
7f06d7c29d
2 changed files with 5 additions and 16 deletions
5
index.js
5
index.js
|
@ -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))
|
||||
|
|
16
posts.json
16
posts.json
|
@ -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":[]}]}]
|
Loading…
Reference in a new issue