declare var pjs;
declare var productsp;
declare var pds;
export class tsmodule3 {
constructor(request: any, res: any) {
pjs.defineTable("productsp", "pjstest/productsp", { read: true, keyed: true });
pjs.define("pds", { type: 'data structure', likeRec: 'products' });
var pid = request.query.pid;
if (pid) {
pid = Number(pid.trim());
}
if (!pid || isNaN(pid)) {
res.send(`Query parameter pid is required to be a number. Value sent was [${request.query.pid}]`);
return;
}
// Using the pjs.require API allows for this file to be eligible for hotReloading
let tsclass2: any = pjs.require("tsclass2.ts");
pds = tsclass2.getRecord(pid);
res.status(200).json(pjs.toObject(pds));
}
} |