Initial commit: added frontend and backend

This commit is contained in:
2026-09-22 12:02:38 +05:30
commit cd2770e590
154 changed files with 25892 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function(app) {
app.use(
'/wacto-api',
createProxyMiddleware({
target: 'https://api.wacto.app',
changeOrigin: true,
pathRewrite: {
'^/wacto-api': '', // remove /wacto-api from the request URL
},
onProxyReq: function(proxyReq, req, res) {
// Bypass Origin headers so Wacto API thinks the request is local to itself
proxyReq.setHeader('Origin', 'https://api.wacto.app');
}
})
);
app.use(
'/perfectcorp-api',
createProxyMiddleware({
target: 'https://yce-api-01.perfectcorp.com',
changeOrigin: true,
pathRewrite: {
'^/perfectcorp-api': '', // remove prefix from proxied request
},
onProxyReq: function(proxyReq, req, res) {
// Spoof the origin similarly for PerfectCorp's S2S security wall
proxyReq.setHeader('Origin', 'https://yce-api-01.perfectcorp.com');
}
})
);
};