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

Setup/basic server deployment #23

Merged
merged 3 commits into from
Apr 16, 2019
Merged

Conversation

ali-7
Copy link
Contributor

@ali-7 ali-7 commented Apr 15, 2019

relates #10

  • create a basic express server to serve react app

@ali-7 ali-7 added this to In progress in Commons via automation Apr 15, 2019
@ali-7 ali-7 moved this from In progress to Needs Review in Commons Apr 15, 2019
Copy link
Contributor

@Oliversw Oliversw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had a couple of little comments on the code that I left there!

@@ -6,7 +6,16 @@
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "2.1.8",
"styled-components": "^4.2.0"
"styled-components": "^4.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this what you mentioned about eslint needing to be a dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, styled-components is a package that we discuss to use instead of CSS directly.

those some of the dependances that makes the build errors eslint-plugin-import, eslint-plugin-jsx-a11y

an example error at heroku build log:

 Creating an optimized production build...
       Failed to compile.
       
       ./src/index.js
       Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import'
       Referenced from: 
           at Array.forEach (<anonymous>)
           at Array.reduceRight (<anonymous>)

@@ -2,12 +2,15 @@
"name": "commons",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain why we have to have two package.jsons? I see that it is because we have the client folder, but don't quite understand why we need it. I haven't seen that before. Thanks!

Copy link
Contributor Author

@ali-7 ali-7 Apr 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

creat-react-app run internally on a separate server and also need to run it scripts and make a node environment. (it's like this server for the front)
localhost:3000

node-server is the other one. localhost:5000

when u work on express and react ( actually u work on two servers)
each one has his own environments and dependances


const port = process.env.PORT || 5000;

app.listen(port, () => console.log(`App listen on port ${port}`));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank god for express! 😊 Looks great!

Copy link
Contributor

@teenie-quaggard teenie-quaggard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanations. Looks good to me.

@ali-7 ali-7 merged commit 9e0ff8c into development Apr 16, 2019
Commons automation moved this from Needs Review to Done Apr 16, 2019
@ali-7 ali-7 deleted the setup/basic-server-deployment branch April 16, 2019 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Commons
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants