You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Toolpad requires starting up its own server process with toolpad start. Instead I'd like to be able to integrate a Toolpad application into my own server. I wish Toolpad would be able to generate a module that I could directly import in my express(-like) server and call in any connect middleware compatible webserver.
Examples 🌈
After running
toolpad build
I can import a generated module from e.g. ./toolpad/.generated/server which I can use as follows:
// ./server.jsimportexpressfrom'express';importpathfrom'path;import { createHandler } from '@mui/toolpad';
consttoolpadHandler=createHandler({dir: path.resolve(process.cwd(),'./myApp'),basePath: '/toolpad'})constapp=express()app.use('/foo',(req,res)=>{// ... my own application logic})app.use('/toolpad',toolpadHandler)constserver=app.listen(3000)
Now I can run my application
node ./server.js
and Can access the toolpad application on http://localhost:3000/toolpad
Motivation 🔦
This could lower the barrier for teams that don't maintain their own infrastructure as it should allow them to integrate Toolpad without infrastructure changes.
Duplicates
Latest version
Summary 💡
Currently Toolpad requires starting up its own server process with
toolpad start
. Instead I'd like to be able to integrate a Toolpad application into my own server. I wish Toolpad would be able to generate a module that I could directly import in my express(-like) server and call in any connect middleware compatible webserver.Examples 🌈
After running
I can import a generated module from e.g.
./toolpad/.generated/server
which I can use as follows:Now I can run my application
and Can access the toolpad application on
http://localhost:3000/toolpad
Motivation 🔦
This could lower the barrier for teams that don't maintain their own infrastructure as it should allow them to integrate Toolpad without infrastructure changes.
Steps
basePath
The text was updated successfully, but these errors were encountered: