Add apiv2 bridge router to server for legacy API integration
This commit is contained in:
@@ -37,6 +37,7 @@ import productEditorAuditLogRouter from './routes/product-editor-audit-log.js';
|
||||
import newsletterRouter from './routes/newsletter.js';
|
||||
import linesAggregateRouter from './routes/linesAggregate.js';
|
||||
import repeatOrdersRouter from './routes/repeat-orders.js';
|
||||
import apiv2BridgeRouter from './routes/apiv2-bridge.js';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
@@ -142,6 +143,10 @@ async function startServer() {
|
||||
app.use('/api/newsletter', newsletterRouter);
|
||||
app.use('/api/lines-aggregate', linesAggregateRouter);
|
||||
app.use('/api/repeat-orders', repeatOrdersRouter);
|
||||
// Side-service: lets external apps (import / product-edit skills) post to the
|
||||
// legacy PHP /apiv2 API without a browser cookie. Isolated, additive router;
|
||||
// inherits the same user-JWT auth applied to /api above. See apiv2-bridge.js.
|
||||
app.use('/api/apiv2-bridge', apiv2BridgeRouter);
|
||||
|
||||
app.get('/health', (req, res) => {
|
||||
res.json({
|
||||
|
||||
Reference in New Issue
Block a user