28 lines
704 B
JavaScript
28 lines
704 B
JavaScript
|
'use strict';
|
||
|
|
||
|
// modules
|
||
|
const express = require('express');
|
||
|
|
||
|
const routerHandling = require('../middleware/router-handling');
|
||
|
const createSignature = require('../tools/signature-tool');
|
||
|
|
||
|
const command = new express.Router();
|
||
|
|
||
|
command.route('/createSignature/:id')
|
||
|
.post((req, res, next) => {
|
||
|
const userId = req.params.id;
|
||
|
createSignature(userId, res, next);
|
||
|
})
|
||
|
|
||
|
.all(
|
||
|
routerHandling.httpMethodNotAllowed
|
||
|
);
|
||
|
|
||
|
|
||
|
// 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;
|