Add server

This commit is contained in:
Sambo Chea 2022-08-17 20:05:53 +07:00
parent cec34e922d
commit 67db40dd66
Signed by: sombochea
GPG Key ID: 3C7CF22A05D95490
4 changed files with 1040 additions and 2 deletions

1
Procfile Normal file
View File

@ -0,0 +1 @@
web: npm run start

16
index.js Normal file
View File

@ -0,0 +1,16 @@
const express = require('express')
const os = require('os')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.json({
message: 'Hello World!',
instance: os.hostname(),
status: 'ok'
})
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})

1018
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,12 +4,15 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "start": "node index.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git.cubetiqs.com/cubetiq/nodejs-server-example.git" "url": "https://git.cubetiqs.com/cubetiq/nodejs-server-example.git"
}, },
"author": "", "author": "",
"license": "ISC" "license": "ISC",
"dependencies": {
"express": "^4.18.1"
}
} }