mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-16 00:25:30 +00:00
Updated examples
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* have to wait two minutes.
|
||||
*/
|
||||
|
||||
import app from "./webserver";
|
||||
import app, { getCertificates } from "./webserver";
|
||||
import path from "path";
|
||||
import { PKPass } from "passkit-generator";
|
||||
|
||||
@@ -19,6 +19,8 @@ app.all(async function manageRequest(request, response) {
|
||||
return;
|
||||
}
|
||||
|
||||
const certificates = await getCertificates();
|
||||
|
||||
const passName =
|
||||
request.params.modelName +
|
||||
"_" +
|
||||
@@ -32,19 +34,10 @@ app.all(async function manageRequest(request, response) {
|
||||
`../models/${request.params.modelName}`,
|
||||
),
|
||||
certificates: {
|
||||
wwdr: path.resolve(
|
||||
__dirname,
|
||||
"../../certificates/WWDR.pem",
|
||||
),
|
||||
signerCert: path.resolve(
|
||||
__dirname,
|
||||
"../../certificates/signerCert.pem",
|
||||
),
|
||||
signerKey: path.resolve(
|
||||
__dirname,
|
||||
"../../certificates/signerKey.pem",
|
||||
),
|
||||
signerKeyPassphrase: "123456",
|
||||
wwdr: certificates.wwdr,
|
||||
signerCert: certificates.signerCert,
|
||||
signerKey: certificates.signerKey,
|
||||
signerKeyPassphrase: certificates.signerKeyPassphrase,
|
||||
},
|
||||
},
|
||||
Object.assign(
|
||||
@@ -62,6 +55,10 @@ app.all(async function manageRequest(request, response) {
|
||||
|
||||
// setting the expiration
|
||||
pass.setExpirationDate(d);
|
||||
console.log(
|
||||
"EXPIRATION DATE EXPECTED:",
|
||||
pass.props["expirationDate"],
|
||||
);
|
||||
}
|
||||
|
||||
const stream = pass.getAsStream();
|
||||
|
||||
Reference in New Issue
Block a user