- package.json
start
script runs production build and starts json-server. Static dist files will be served by json-server.start:dev
script concurrently runs "normal" create-react-app dev build and json-server on separate ports.json-server
dependency
- server.js
- Adds custom route for database resources by appending
/api
to the start of all db routes - Looks at request url and assumes if it doesn't begin with
/api
to just return the react app
- Adds custom route for database resources by appending
- data.js
- Database interaction module
- Uses the following code to determine if the app is in
production
mode and sets the db url accordingly. In DEV mode the json-serve will be running on a separate port than the react dev server. In PROD mode, the json-server will also be serving the static files
const baseUrl = process.env.NODE_ENV === 'production' ? "/api/" : "http://localhost:5002/api/";
-
Notifications
You must be signed in to change notification settings - Fork 1
nss-day-cohort-29/c29-heroku-test
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Simple react/json-server app that can be (easily?) deployed to heroku.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published