Hai, this is my first time posting to this subreddit, so... Hello!! Apologies if this isn't a place to discuss open questions. I'm a hobbyist web developer and a first year student at Uni majoring in CS, I've always experimented with PHP using CodeIgniter as a framework or without a framework and the past year started with NodeJS.As far as I know, you should have a simple file server to serve static html files running on port 80, cause it's the default port for http requests I believe, then inside the html files you would Http requests sent to the backend running at a different port then that backend server (usually I use express) communicates with the database and replies with the entries to be displayed into the screen.In that case, How do you handle dynamic routes like: /blog/518 on a file server and how is cors handled since the two servers are running on different ports, wouldn't that generate a cors error message? and finally how does deployment go in like Heroku or something?On the other hand, I've used a single express server to both render out files using a templating engine like ejs and also serve data needed for the webpage, example the blog post data and the comments. In that case, is it better to pass the data when rendering the page or have an http request on the page load data and draw them to the page.Is the first approach better than the second one? or does it depend on any factors?One more thing, frontend framework vs no frontend framework? opinions?Thank you for taking the time for reading this,Hope someone can answer my questions, I believe these questions are among the FAQ for hobbyists who haven't had professional experience yet like me :). And apologies if it's against community rules to post open questions.
Submitted July 02, 2020 at 10:16AM by abderrazak1307
No comments:
Post a Comment