abapGit/test/express.mjs
Lars Hvam 5dd4d83f3f
Some checks failed
main-build / build-merged (push) Has been cancelled
main-build / auto-tag (push) Has been cancelled
main-build / coverage (push) Has been cancelled
main-build / auto-tag-artifact (push) Has been cancelled
ajson mirror / pr_ajson_changes (push) Has been cancelled
testing: transpiled abapGit running on web via express js (#7008)
2024-08-02 08:06:32 +02:00

26 lines
657 B
JavaScript

import express from 'express';
import {initializeABAP} from "../output/init.mjs";
import {cl_express_icf_shim} from "../output/cl_express_icf_shim.clas.mjs";
await initializeABAP();
const PORT = 3000;
const app = express();
app.disable('x-powered-by');
app.set('etag', false);
app.use(express.raw({type: "*/*"}));
// ------------------
app.get('/', function (req, res) {
res.send('path: /');
});
// ------------------
app.all(["/sap", "/sap*"], async function (req, res) {
await cl_express_icf_shim.run({req, res, class: "ZCL_ABAPGIT_WEB_SICF"});
});
app.listen(PORT);
console.log("Listening on port http://localhost:" + PORT + "/sap/zabapgit/");