cereallarceny / cra-ssr

[DEPRECATED] Server-side rendering with create-react-app, React Router v4, Helmet, Redux, and Thunk
484 stars 118 forks source link

Sample data API #59

Closed sabitertan closed 2 years ago

sabitertan commented 5 years ago

This can help a new starter to understand better about API calls.

sabitertan commented 5 years ago

IMO images shouldn't be a concern of app. They should be served by web server or varnish. I am not sure if you want to automate 'data server' or change documentation for running express server under data. I also created experimental branch(I didnt want to mess your work) that I am trying to render JSONSchema files on the fly. https://github.com/future-cms/react-frontend

cereallarceny commented 5 years ago

I think you might be misunderstanding @sabitertan. The PR you made has the same images in two locations, in the src folder and in the public folder. You should probably delete the ones in src. I believe you made a "copy", when you intended to "move" them. :)

sabitertan commented 5 years ago

I think I am not following issue here I deleted ones under src/. assets/ folder moved to public/, what else should be done? Should I close this one and create new PR?

cereallarceny commented 5 years ago

Ahh, my misunderstanding @sabitertan. I am fine with the PR now but actually have 1 further improvement. Let's move the API you built in the data directory into the existing server directory. You can put your same logic in the server/server.js file and launch everything from the same package.json file.

Conceptually this PR is correct, but I would prefer to keep the folder structure smaller. There's no need for a favicon and there's no need to add the data folder if we already have a node instance running in the server folder.