DELETED SERVER.JS
This commit is contained in:
parent
ea28066f57
commit
c0abece6d4
@ -1,6 +0,0 @@
|
|||||||
FROM node:latest
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
COPY . .
|
|
||||||
RUN npm install
|
|
||||||
EXPOSE 5050
|
|
||||||
CMD [ "node", "server.js" ]
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
let express = require('express')
|
|
||||||
let logger = require('morgan')
|
|
||||||
|
|
||||||
let app = express()
|
|
||||||
app.use(logger('dev'))
|
|
||||||
app.use(express.static('views'))
|
|
||||||
|
|
||||||
app.set('view engine', 'ejs')
|
|
||||||
app.set('views', __dirname + '/views')
|
|
||||||
|
|
||||||
|
|
||||||
// app.get('/', function(request, responce) {
|
|
||||||
// responce.render('index.ejs')
|
|
||||||
// })
|
|
||||||
|
|
||||||
app.get('/water', function(req, res) {
|
|
||||||
res.send({ success: true, value: 20 })
|
|
||||||
})
|
|
||||||
|
|
||||||
app.get('*', function(request, responce) {
|
|
||||||
res.redirect('siot.maxhunt.design');
|
|
||||||
})
|
|
||||||
|
|
||||||
app.post('*', function(request, responce) {
|
|
||||||
responce.status(404).send({ success: false, error: "404" })
|
|
||||||
})
|
|
||||||
|
|
||||||
var port = 5050
|
|
||||||
|
|
||||||
app.listen(port, function() {
|
|
||||||
console.log('Server running on port ' + port)
|
|
||||||
})
|
|
||||||
Loading…
Reference in New Issue
Block a user