i have a nodejs expressjs app which uses slack, jsforce, and a internal api to perform…
- User
i have a nodejs expressjs app which uses slack, jsforce, and a internal api to perform some processes and syncing. I need to add a couple of pages which must use the same port 80 along with the api - i can have an api endpoint that provides some data which needs to be presented to the user. I would like to use vuejs, but i'm currently running pug which i'll still want to keep. what's the best way to do this
Assistant
There are several ways to add pages to an existing Express.js application while keeping the existing API on port 80. Here are a few options:
-
Use a separate port for the new pages: You can add a new port to your application and use it for the new pages. This way, you can keep the existing API on port 80 and the new pages on a separate port.
-
Use a reverse proxy: You can use a reverse proxy such as Nginx or HAProxy to route traffic to the new pages while keeping the existing API on port 80. This way, you can have multiple applications running on the same port and route traffic to the appropriate application based on the URL.
-
Use a single-page application (SPA): You can use a single-page application (SPA) framework such as Vue.js to create a single page that handles all of the routing and navigation. This way, you can keep the existing API on port 80 and have the new pages handled by the same application.
-
Use a separate application: You can create a separate application for the new pages and use a reverse proxy or other routing mechanism to route traffic to the appropriate application based on the URL.
Ultimately, the best way to add pages to an existing Express.js application while keeping the existing API on port 80 will depend on your specific requirements and the existing architecture of your application.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.