Files
sensorapi/app.js
T
admin c3a4ff0b4a Preparation for charts moved from here to laerm app
routes/api.js
   - removed unnecessary table entry

app.js
   - removed unnecessary calls

actions/ddata4maps.js
   - return options as object

sensorspecials/noise.js
   - removed all references to xxxxxData-Calls
   - removed checks for /chart/...

removed route/chartapi.js,  sensorspecials/noisCharts.js and utilites/tables.js
2023-04-07 15:28:42 +02:00

39 lines
917 B
JavaScript

import createError from 'http-errors'
import logger from 'morgan'
import express from 'express'
import cookieParser from 'cookie-parser'
import cors from 'cors'
import indexRouter from './routes/index.js'
import { apiRouter } from './routes/api.js'
const app = express()
app.use(cors())
app.use(logger('dev'))
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
app.use(cookieParser())
app.use('/', indexRouter)
app.use('/api', apiRouter)
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404))
})
// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message
res.locals.error = req.app.get('env') === 'development' ? err : {}
// render the error page
res.status(err.status || 500)
res.send(`ERROR: ${err.status}, ${err.stack}`)
})
export default app