opt-cc/server/routes/command.js

28 lines
704 B
JavaScript
Raw Normal View History

2018-03-12 09:26:44 +01:00
'use strict';
2017-05-10 11:04:06 +02:00
// modules
const express = require('express');
const routerHandling = require('../middleware/router-handling');
2017-10-20 23:42:41 +02:00
const createSignature = require('../tools/signature-tool');
2017-05-10 11:04:06 +02:00
const command = new express.Router();
2017-05-10 11:04:06 +02:00
command.route('/createSignature/:id')
2018-02-26 09:04:27 +01:00
.post((req, res, next) => {
const userId = req.params.id;
createSignature(userId, res, next);
})
.all(
routerHandling.httpMethodNotAllowed
);
2017-05-10 11:04:06 +02:00
// this middleware function can be used, if you like or remove it
// it looks for object(s) in res.locals.items and if they exist, they are send to the client as json
command.use(routerHandling.emptyResponse);
module.exports = command;