mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
replace api/settings and customizatons with secure REST calls #501
This commit is contained in:
@@ -1193,16 +1193,19 @@ rest_server.get(SYSTEM_INFO_ENDPOINT, (req, res) => {
|
||||
res.json(emsesp_info)
|
||||
})
|
||||
|
||||
const SYSTEM_SETTINGS_ENDPOINT = API_ENDPOINT_ROOT + 'system/settings'
|
||||
rest_server.post(SYSTEM_SETTINGS_ENDPOINT, (req, res) => {
|
||||
console.log('System Settings POST: ' + JSON.stringify(req.body))
|
||||
res.sendStatus(200)
|
||||
})
|
||||
rest_server.get(SYSTEM_SETTINGS_ENDPOINT, (req, res) => {
|
||||
console.log('System Settings GET')
|
||||
const GET_SETTINGS_ENDPOINT = REST_ENDPOINT_ROOT + 'getSettings'
|
||||
rest_server.get(GET_SETTINGS_ENDPOINT, (req, res) => {
|
||||
console.log('System Settings:')
|
||||
res.json(settings)
|
||||
})
|
||||
|
||||
const GET_CUSTOMIZATIONS_ENDPOINT = REST_ENDPOINT_ROOT + 'getCustomizations'
|
||||
rest_server.get(GET_CUSTOMIZATIONS_ENDPOINT, (req, res) => {
|
||||
console.log('Customizations:')
|
||||
// not implemented yet
|
||||
res.sendStatus(200)
|
||||
})
|
||||
|
||||
// start server
|
||||
const expressServer = rest_server.listen(port, () =>
|
||||
console.log(`Mock server for EMS-ESP is up and running at http://localhost:${port}`),
|
||||
|
||||
Reference in New Issue
Block a user