Added working examples for barcode, localization, fields and expiration with working pass models and webserver

This commit is contained in:
alexandercerutti
2018-08-29 18:38:22 +02:00
parent b9ede238c2
commit 458ef1c481
25 changed files with 498 additions and 0 deletions

25
examples/webserver.js Normal file
View File

@@ -0,0 +1,25 @@
/*
* Generic webserver instance for the examples
* @Author Alexander P. Cerutti
*/
const express = require("express");
const app = express();
app.use(express.json());
app.listen(8080, "0.0.0.0", function(request, response) {
console.log("Webserver started.");
});
app.all("/", function (request, response) {
response.redirect("/gen/");
});
app.route("/gen")
.all((req, res) => {
res.set("Content-Type", "text/html");
res.send("Cannot generate a pass. Specify a modelName in the url to continue. <br/>Usage: /gen/<i>modelName</i>")
});
module.exports = app.route("/gen/:modelName");