-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate deploying react-admin
as soul
extension
#5
Comments
I have created an extension inside the souls core folder, and i am now able to render the react app i built from the //soul/core/_extensions/api.js
const path = require("path");
const express = require("express");
const reactAdminClient = {
method: "GET",
path: "/api/client",
handler: (req, res, db) => {
const clientPath = path.join(__dirname, "dist", "index.html");
res.app.use(express.static(path.join(__dirname, "dist")));
res.sendFile(path.join(clientPath));
},
};
module.exports = {
reactAdminClient,
}; The issueSoul expects us to create our extension API inside the - const apiExtensions = require(`${extensionsPath}/${extension}`);
+ const apiExtensions = require(`../${extensionsPath}/${extension}`); I am still trying to make it work without editing the source code, but even if i change the location of my |
if you are sure about that issue, post it on Soul, please. |
ok, i will create an issue |
I have submitted the issue here |
The maintainer has answered my question, the issue was that I was supposed to pass the Absolute path of the |
We currently have to configure
soul
to overcome CORS requests.But, if we served the static built
react-admin
as asoul
extension, all requests would come from the host url.Extensions are documented here: https://github.com/thevahidal/soul/blob/main/docs/extensions-examples.md
The big-picture is to:
a) serves our app
b) connects to Soul API
For that deployment strategy, we can probably even simplify the react-admin setup, since we don't need to specify the IP/Port for the soul server - it's the current one 🙂
The text was updated successfully, but these errors were encountered: