Commit 288658f4 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/auto-reload' into dev-merge

parents 60edf362 69c6ae9e
{
sourceMaps: "inline",
presets: [
["@babel/preset-env", {"useBuiltIns": "usage", "corejs": 3}],
"@babel/preset-react"
],
plugins: []
}
const { createProxyMiddleware } = require("http-proxy-middleware");
module.exports = function (app) {
app.use("/api/v1.0/auth", createProxyMiddleware({
target: 'http://127.0.0.1:8008/api/v1.0/auth',
changeOrigin: true,
}))
// app.use("/api", createProxyMiddleware({
// target: 'http://127.0.0.1:8008/api',
// changeOrigin: true,
// }))
app.use(
"/ws",
createProxyMiddleware({
target: "ws://127.0.0.1:8008",
ws: true,
changeOrigin: true,
logger: console,
on: {
proxyRes: (proxyRes, req, res) => {
console.log(`[Proxy Response] ${req.method} ${req.url} <- ${proxyRes.statusCode}`);
},
proxyReqWs: (proxyReq, req, socket, options, head) => {
console.log(`WS RESPONSE, ${req.method} ${req.url} <- ${proxyReq.getHeader("host")}`);
proxyReq.setHeader("origin", "http://localhost:8008");
},
proxyReq: (proxyReq, req, res) => {
console.log(`[Proxy Req] ${req.method} ${req.url} <- ${proxyReq.getHeader("host")}`);
proxyReq.setHeader("origin", "http://localhost:8008");
},
error: (err, req, res) => {
console.error(`[Proxy Error] ${req.method} ${req.url} - ${err.message}`);
res.writeHead(500, { "Content-Type": "text/plain" });
res.end("Proxy error occurred.");
}
}
})
);
};
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>CNRS GarganText</title>
<link rel="stylesheet" href="../icons/forkawesome.css">
<!-- <link href="styles/bootstrap.min.css" rel="stylesheet"> -->
<link id="bootstrap-css" href="../styles/bootstrap-default.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../styles/highlightjs-solarized-light.css" />
<style> * {margin: 0; padding: 0; list-style: none;} </style>
</head>
<body>
<div id="app"></div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.6/dist/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.2.1/dist/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script> <div id="portal"></div>
<!-- <script type="module" src="../js/jquery.js"></script> -->
<!-- <script type="module" src="../js/bootstrap@4.6.2/bootstrap.bundle.min.js"></script> -->
<script type="module" src="../bundle.min.js"></script>
</body>
</html>
......@@ -12,7 +12,7 @@
<body>
<div id="app"></div>
<div id="portal"></div>
<script src="js/jquery@3.5.1/jquery.slim.min.js"></script>
<script src="js/jquery.js"></script>
<script src="js/bootstrap@4.6.2/bootstrap.bundle.min.js"></script>
<script src="bundle.min.js"></script>
</body>
......
This diff is collapsed.
This diff is collapsed.
......@@ -26,6 +26,8 @@
#spago-unstable
esbuild
nodejs
watchexec
pscid
nodePackages.npm
];
......
This diff is collapsed.
......@@ -4,8 +4,10 @@
"scripts": {
"build": "spago build",
"bundle": "spago bundle --module Main --outfile dist/bundle.min.js --minify --source-maps",
"css": "$npm_execpath run css-themes",
"css-themes": "$npm_execpath run css-default-theme && $npm_execpath run css-dark-theme && $npm_execpath run css-darkster-theme && $npm_execpath run css-greyson-theme && $npm_execpath run css-herbie-theme && $npm_execpath run css-monotony-theme",
"build-dev": "spago bundle --module Main --outfile dist/bundle.min.js",
"watch": "watchexec -e purs -- npm run build-dev",
"css": "$npm_execpath css-themes",
"css-themes": "$npm_execpath css-default-theme && $npm_execpath css-dark-theme && $npm_execpath css-darkster-theme && $npm_execpath css-greyson-theme && $npm_execpath css-herbie-theme && $npm_execpath css-monotony-theme",
"css-default-theme": "sass src/sass/themes/default.scss:dist/styles/bootstrap-default.css",
"css-dark-theme": "cp node_modules/bootstrap-dark/src/bootstrap-dark.css dist/styles/bootstrap-dark.css",
"css-darkster-theme": "sass src/sass/themes/darkster.scss:dist/styles/bootstrap-darkster.css",
......@@ -16,7 +18,9 @@
"repl": "spago repl",
"server": "serve -l 8008 dist",
"server-ssl": "ssl-serve --ssl dist",
"test": "spago test"
"test": "spago test",
"dev": "concurrently \"npm run watch\" \"npm run serve\" ",
"serve": "npx parcel serve --dist-dir ./dist/dev/bundle ./dist/dev/index.html"
},
"dependencies": {
"@fontsource/crete-round": "~5.0.12",
......@@ -32,6 +36,7 @@
"bootstrap": "~4.6.0",
"bootstrap-dark": "~1.0.3",
"buffer": "~6.0.3",
"concurrently": "^9.1.0",
"create-react-class": "~15.6.3",
"crypto": "~1.0.1",
"d3": "~7.6.1",
......@@ -47,6 +52,7 @@
"graphql": "~15.6.1",
"graphql-ws": "~5.5.0",
"highlightjs": "~9.16.2",
"http-proxy-middleware": "^3.0.3",
"immer": "~9.0.5",
"isomorphic-unfetch": "~3.1.0",
"markdown-it": "~13.0.1",
......@@ -70,6 +76,7 @@
"@getgauge/cli": "~1.4.0",
"esbuild": "~0.21.1",
"parcel": "~2.8.2",
"process": "^0.11.10",
"react-testing-library": "~8.0.1",
"sass": "~1.77.0",
"serve": "~14.2.3",
......
......@@ -15,25 +15,26 @@ import Gargantext.Utils (href)
defaultBackends :: NonEmpty Array Backend
defaultBackends = backend' "Demo" "Public Show room" "https://demo.gargantext.org"
:| [ backend' "Education" "Training/Formation" "https://formation.gargantext.org"
, backend' "Academia" "Academia" "https://academia.sub.gargantext.org"
, backend' "Organization" "CNRS" "https://cnrs.gargantext.org"
, backend' "Organization" "Mines Telecom Institute" "https://imt.sub.gargantext.org"
, backend' "Organization" "Hello Word Company" "https://helloword.gargantext.org"
, backend' "Community" "Complex Systems" "https://complexsystems.gargantext.org"
, backend' "Networking" "European Projects" "https://europa.gargantext.org"
, backend' "Community" "Earth" "https://earth.sub.gargantext.org"
, backend' "Community" "Health" "https://health.sub.gargantext.org"
, backend' "Community" "MSH" "https://msh.sub.gargantext.org"
, backend' "Development" "Main SandBox" "https://dev.sub.gargantext.org"
, backend' "Private" "Offline Bunker" "http://localhost:8008"
]
defaultBackends = backend' "Demo" "Public Show room" "https://demo.gargantext.org"
:|
[ backend' "Education" "Training/Formation" "https://formation.gargantext.org"
, backend' "Academia" "Academia" "https://academia.sub.gargantext.org"
, backend' "Organization" "CNRS" "https://cnrs.gargantext.org"
, backend' "Organization" "Mines Telecom Institute" "https://imt.sub.gargantext.org"
, backend' "Organization" "Hello Word Company" "https://helloword.gargantext.org"
, backend' "Community" "Complex Systems" "https://complexsystems.gargantext.org"
, backend' "Networking" "European Projects" "https://europa.gargantext.org"
, backend' "Community" "Earth" "https://earth.sub.gargantext.org"
, backend' "Community" "Health" "https://health.sub.gargantext.org"
, backend' "Community" "MSH" "https://msh.sub.gargantext.org"
, backend' "Development" "Main SandBox" "https://dev.sub.gargantext.org"
, backend' "Private" "Offline Bunker" "http://localhost:8008"
, backend' "Parcel" "Offline Bunker" "http://localhost:1234"
]
where
backend' t n u = backend t n V10 "/api/" u
backend' t n u = backend t n V10 "/api/" u
matchCurrentLocation :: Effect (Maybe Backend)
matchCurrentLocation = do
......@@ -84,4 +85,3 @@ defaultFrontends = Frontends { app: defaultApp, static: defaultStatic }
changePort :: String -> String
changePort = S.replace (S.Pattern "http://localhost:8000/") (S.Replacement "http://localhost:8008/")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment