Add server
This commit is contained in:
parent
cec34e922d
commit
67db40dd66
16
index.js
Normal file
16
index.js
Normal 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
1018
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,12 +4,15 @@
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
"start": "node index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.cubetiqs.com/cubetiq/nodejs-server-example.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.18.1"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user