Adding /showsettings endpoint to display settings table
This commit is contained in:
@@ -72,7 +72,7 @@ app.get('/getdata', (req, res) => {
|
||||
})
|
||||
});
|
||||
|
||||
// Export all data for development
|
||||
// Handle requests for /exportall by retrieving all data and returning a JSON object
|
||||
app.get('/exportall', (req, res) => {
|
||||
// Check that the expected key has been included with the web request
|
||||
if (!req.headers['export-key'] || req.headers['export-key'] != process.env.SECRET) {
|
||||
@@ -84,6 +84,13 @@ app.get('/exportall', (req, res) => {
|
||||
})
|
||||
})
|
||||
|
||||
// Handle requests for /showsettings by retrieving all settings from the database and returning a JSON object
|
||||
app.get('/showsettings', (req, res) => {
|
||||
db.Settings.findAll().then((result) => {
|
||||
res.status(200).send(result).end();
|
||||
})
|
||||
})
|
||||
|
||||
// Handle requests to /cleanup by deleting any data older than 90 days from the datastore
|
||||
app.get('/cleanup', (req, res) => {
|
||||
if (!req.headers['cleanup-key'] || req.headers['cleanup-key'] != process.env.SECRET) {
|
||||
|
||||
Reference in New Issue
Block a user