add credits/index.js

This commit is contained in:
Daniel Brahneborg 2020-04-14 14:29:13 +02:00
parent c49cd95a98
commit 3e9b57c145
2 changed files with 21 additions and 0 deletions

20
credits/index.js Normal file
View file

@ -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

View file

@ -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')