Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@koptionalsoftware
Last active March 31, 2020 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koptionalsoftware/b83bcb525e542fb8aeada21fa73ae40c to your computer and use it in GitHub Desktop.
Save koptionalsoftware/b83bcb525e542fb8aeada21fa73ae40c to your computer and use it in GitHub Desktop.
const drawSignatures = require("./drawSignatures");
const express = require("express");
const bodyParser = require("body-parser");
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.post("/", async (request, response) => {
try {
const bytes = await drawSignatures.drawSignatures(request.body.doc, request.body.signature);
return response.send(bytes);
}
catch (err) {
return response.status(500).send({ message: err.message });
}
});
module.exports = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment