From 3e9b57c1452f3dcb7a21034cdbf6317f25138a25 Mon Sep 17 00:00:00 2001 From: Daniel Brahneborg Date: Tue, 14 Apr 2020 14:29:13 +0200 Subject: [PATCH] add credits/index.js --- credits/index.js | 20 ++++++++++++++++++++ index.js | 1 + 2 files changed, 21 insertions(+) create mode 100644 credits/index.js diff --git a/credits/index.js b/credits/index.js new file mode 100644 index 0000000..c34455a --- /dev/null +++ b/credits/index.js @@ -0,0 +1,20 @@ + +const express = require('express') +const router = express.Router() + +// The following endpoints are supported. +// +// /update - json fields: userid, column, and mods + +router.post('/update', (req, res) => { + console.log('in update, body:', req.body) + let respbuf = '' + res.send(respbuf) +}) + +router.use((req, res, next) => { + console.log('nothing to do for %s %s', req.method, req.url) + res.status(404).end() +}) + +module.exports = router diff --git a/index.js b/index.js index 6afe7fa..b080653 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ app.use(express.json()); // connect the plugin(s) app.use('/plugin', require('./plugin')) app.use('/plugin2', require('./plugin2')) +app.use('/credits', require('./credits')) // catch 404 and forward to error handler const createError = require('http-errors')