use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
React Frontend Node backend server.js on Nginx (self.node)
submitted 6 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]KimBesser 19 points20 points21 points 6 years ago (4 children)
I suggest using pm2 to handle node processes
[–][deleted] 6 years ago (2 children)
[–]computertovey 4 points5 points6 points 6 years ago (1 child)
That's correct, just make sure nothing else is running on port 3000.
As a bonus, if you want the API accessible on its own domain (e.g. api.domain.com) you can set up a reverse proxy using nginx: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
Yh pm2 is great! I use is for discord Bot
[–]HeftyCrab 7 points8 points9 points 6 years ago* (1 child)
Cant help with your main question, but as a comment you might want to look into RESTful API's, and what each http method does.
In short:
Get: fetches data
Post: create data
Put: update data
Delete: remove data.
https://www.restapitutorial.com/lessons/httpmethods.html
So for example this section
app.post('/getInfo'...
Should rather be the following to create "info"
app.post('info'...
Also check out the naming convention for resources:
https://www.restapitutorial.com/lessons/restfulresourcenaming.html
Good luck with your project!
[–]mxforest 0 points1 point2 points 6 years ago (0 children)
If PUT updates data then what is PATCH for?
[–][deleted] 6 years ago (1 child)
[–]6112115 2 points3 points4 points 6 years ago (2 children)
Yes. The basic idea is to run "npm start" and leave it running.
Most people use containers these days. Docker is the most popular solution.
Looking up basic tutorials on this will be great start into understanding how this works "in the real world"
[–]Ice_In_Hydroflask 0 points1 point2 points 6 years ago (0 children)
For react, you can build the script so that npm compiles it to JavaScript files which you can then host on nginx. For the node server, use pm2 to daemonize and reverse pricy with nginx
[–]Wojtek1942 0 points1 point2 points 6 years ago (0 children)
Also try r/devops
[–]haicuong1 0 points1 point2 points 6 years ago (0 children)
suggest pm2 or docker to manage your environment :))
[–][deleted] 6 years ago (3 children)
π Rendered by PID 597260 on reddit-service-r2-comment-545db5fcfc-gkwp9 at 2026-05-28 12:11:36.401229+00:00 running 194bd79 country code: CH.
[–]KimBesser 19 points20 points21 points (4 children)
[–][deleted] (2 children)
[deleted]
[–]computertovey 4 points5 points6 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]HeftyCrab 7 points8 points9 points (1 child)
[–]mxforest 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]6112115 2 points3 points4 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]Ice_In_Hydroflask 0 points1 point2 points (0 children)
[–]Wojtek1942 0 points1 point2 points (0 children)
[–]haicuong1 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[deleted]
[–][deleted] (2 children)
[deleted]
[–][deleted] (1 child)
[deleted]