bug fix for saving and restarting notebook
This commit is contained in:
parent
330baa51ac
commit
eadf769ab3
4 changed files with 54 additions and 44 deletions
|
|
@ -3,20 +3,22 @@ const api = require("express").Router();
|
|||
|
||||
const ASSIGNMENT_SERVICE_URL = process.env.ASSIGNMENT_SERVICE_URL;
|
||||
|
||||
// rerout to asisgnment url
|
||||
api.use((req, res, next) => {
|
||||
console.log(`Proxying request to: ${ASSIGNMENT_SERVICE_URL} : original url : ${req.originalUrl}`);
|
||||
next();
|
||||
});
|
||||
|
||||
api.use(
|
||||
'/',
|
||||
'/',
|
||||
createProxyMiddleware({
|
||||
target: ASSIGNMENT_SERVICE_URL,
|
||||
changeOrigin: true,
|
||||
logLevel: 'debug',
|
||||
pathRewrite: {
|
||||
'^/api': '', // only remove /api
|
||||
'^/api': '', // remove "/api" from the start
|
||||
},
|
||||
onProxyReq(proxyReq, req, res) {
|
||||
console.log(`Proxying request to: ${ASSIGNMENT_SERVICE_URL}${req.url}`);
|
||||
},
|
||||
onError(err, req, res) {
|
||||
console.error('Proxy error:', err.message);
|
||||
res.status(502).send('Bad Gateway: Failed to connect to target');
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@ const auth = require("express").Router();
|
|||
const passport = require("passport");
|
||||
const axios = require("axios");
|
||||
|
||||
const express = require("express");
|
||||
|
||||
const bodyParser = require("body-parser");
|
||||
|
||||
auth.use(express.json());
|
||||
auth.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
||||
const AUTH_URL = process.env.AUTH_URL || "http://localhost:8080";
|
||||
|
||||
auth.get(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue