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
{{ message }}
Repository navigation
[dev-task] Separate Webpack Dev server from API server #1348
Good Medium IssueA moderately complex issue for contributors with some experienceHelp WantedWould love additional input or contributions!Priority:HighShould be addressed soon but not criticalType:TaskTasks tied specifically to developer operations and maintenance
Refactoring to enable devs to make frontend changes without running an API server or database, as suggested by @andrewn
Feature enhancement details:
New feature details:
Perhaps a good way forward is separating the webpack dev server from the API server so that the can be run standalone? Then we could also switch to Parcel if we wanted.
Create a new server that runs the dev webpack config on port 3000 and serves the page routes
Print a message telling the user to set API_URL in .env to the correct API server instance (localhost or production)
The missing piece is being able to contact the deployed API. At the moment we restrict CORS origins to only p5js.org. I've opened PR #1398 to address this.
To run the client only, you npm run start:client and to run both npm start.
Once we have this separation, then we can start experimenting with other packagers.
Hi @andrewn, I think that sounds like a clean approach, as long as there aren't any particular security motivations to keep the CORS restrictions. I think this should be fine especially if someone just wants to be running the site in a "stateless" mode.
Good Medium IssueA moderately complex issue for contributors with some experienceHelp WantedWould love additional input or contributions!Priority:HighShould be addressed soon but not criticalType:TaskTasks tied specifically to developer operations and maintenance
Activity
andrewn commentedon Apr 19, 2020
@hydrosquall I started thinking about how we might do this and ended up with a branch that mostly does it...
The general idea is:
API_URLin .env to the correct API server instance (localhost or production)The missing piece is being able to contact the deployed API. At the moment we restrict CORS origins to only
p5js.org. I've opened PR #1398 to address this.To run the client only, you
npm run start:clientand to run bothnpm start.Once we have this separation, then we can start experimenting with other packagers.
What do you think?
hydrosquall commentedon Apr 20, 2020
Hi @andrewn, I think that sounds like a clean approach, as long as there aren't any particular security motivations to keep the CORS restrictions. I think this should be fine especially if someone just wants to be running the site in a "stateless" mode.
feat(developer-experience): configure webpack-dev-server to staticall…