Hi everyone,
Following the documentation, I was able to set up a website which uses nodejs
. It is intended to showcase a full-stack web application that I'm currently developing. First I want to deploy my react
-based frontend (which eventually will be connected to express
-framework-based backend). However, I am stuck at deploying the react application.
I placed the entry file index.js
and the relevant modules and files inside the public_nodejs
directory. I also installed the necessary dependency modules using npm install
. I have two questions:
- When someone visits the url, nothing appears on the web page. I expected to see the contents of
index.js
, which contains app.js
and other modules. What should I do such that when someone visits the url subdomain.domain.com
, the servers serves the requests correctly?
- Then I thought I am supposed to run the react application on the server in order to serve web pages correctly. So, I tried to run the react application by executing
npm run start
at the public_nodejs
directory. But I encountered the following error:
(node:79600) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:79600) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
/usr/home/treblide/domains/i3wd.treblide.com/public_nodejs/node_modules/webpack-dev-server/lib/Server.js:2557
throw error;
^
Error: listen EPERM: operation not permitted 0.0.0.0:40581
Could you clarify why this happened?
- Lastly, I would like to know how to configure the
ngix
server (the server on serv00.com) and the nodejs
such that the routing mechanisms function correctly?
Thanks for reading my post!
I look forward to reading your answers!