mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 22:25:24 +00:00
Added path resolution in examples
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
import app from "./webserver";
|
||||
import { createPass } from "passkit-generator";
|
||||
import path from "path";
|
||||
|
||||
app.all(async function manageRequest(request, response) {
|
||||
const passName =
|
||||
@@ -15,12 +16,21 @@ app.all(async function manageRequest(request, response) {
|
||||
|
||||
try {
|
||||
const pass = await createPass({
|
||||
model: `./models/${request.params.modelName}`,
|
||||
model: path.resolve(
|
||||
__dirname,
|
||||
`../models/${request.params.modelName}`,
|
||||
),
|
||||
certificates: {
|
||||
wwdr: "../certificates/WWDR.pem",
|
||||
signerCert: "../certificates/signerCert.pem",
|
||||
wwdr: path.resolve(__dirname, "../../certificates/WWDR.pem"),
|
||||
signerCert: path.resolve(
|
||||
__dirname,
|
||||
"../../certificates/signerCert.pem",
|
||||
),
|
||||
signerKey: {
|
||||
keyFile: "../certificates/signerKey.pem",
|
||||
keyFile: path.resolve(
|
||||
__dirname,
|
||||
"../../certificates/signerKey.pem",
|
||||
),
|
||||
passphrase: "123456",
|
||||
},
|
||||
},
|
||||
@@ -57,7 +67,7 @@ app.all(async function manageRequest(request, response) {
|
||||
// @ts-ignore - ignoring for logging purposes. Do not replicate
|
||||
console.log(
|
||||
"Added languages",
|
||||
Object.keys(pass.l10nTranslations).join(", "),
|
||||
Object.keys(pass["l10nTranslations"]).join(", "),
|
||||
);
|
||||
|
||||
const stream = pass.generate();
|
||||
|
||||
Reference in New Issue
Block a user