Skip to content
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

Rebuild/seperate backend and frontend #15

Merged
merged 12 commits into from Jun 2, 2019

Conversation

Pjaerr
Copy link
Owner

@Pjaerr Pjaerr commented Jun 2, 2019

No description provided.

Joshua Jackson added 12 commits May 30, 2019 07:36
Moving the backend away from next.js and ssr, using the express backend as purely an API which the frontend will hit and get the exact data it needs in response, will be moving all logic not related to view into the backend, still in progress
In the service there are no catch statements so if anything fails it will fall back to the catch in the controller, this also happens, in the case of getPlaceData service where the request doesn't _fail_ but it returns an invalid status code, in this case we throw the error ourselves. In the controller this is then caught in the catch block and passed into the express next() function which, by default, will send this to the client, to make it more readable we prepend the error returned with a predefined error message that is imported in the controller it will be used. In this case it is an apiGetRequestFailed error.
They both have their own package.json and node modules but the backend has the .env file etc2
Moved all logic for transforming data returned by foursquare onto the serverside so that the frontend only cares about displaying what it is given. Also added cors to the backend restricting the origins"
@Pjaerr Pjaerr merged commit 0e6d861 into rebuild/development Jun 2, 2019
@Pjaerr Pjaerr deleted the rebuild/seperate-backend-and-frontend branch June 2, 2019 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant