Adding a Node.js Development Website
In ServBay, although direct addition of Node.js projects is not currently supported, you can still add and manage Node.js websites using a reverse proxy. This article will detail how to add a Node.js website in ServBay, including steps, precautions, and solutions to common issues.
Overview
ServBay offers a user-friendly interface that simplifies adding and managing websites. By following the steps below, you can easily add a Node.js website in ServBay and configure the relevant settings to ensure proper operation.
Steps to Add a Website
Step 1: Run the Node.js Project
First, you need to run your Node.js project on your server and specify a port. You can refer to the article [[Using Node.js]] to learn how to run your Node.js project with ServBay's built-in Node.js.
Suppose you are currently running a Vue.js project listening on port 8585.
$ npm run dev -- --port 8585
Server running at http://localhost:8585/
2
Step 2: Open the ServBay Management Interface
Find ServBay
in the application, and double-click to open it.
Step 3: Navigate to Host Management
Upon opening the program, you will see the main interface of ServBay. In the navigation menu on the left, click Host
. This will take you to the website management page.
Step 4: Add a New Website
On the website management page, click the +
button at the bottom of the page. This will open a new form on the right to enter the basic information for the new website.
Step 5: Configure Website Settings
In the page for adding a website, you need to fill in the following information:
- Name: The name of the website, used for identification.
- Domain Name: Enter the domain name of the website you wish to add, e.g.,
nodejs.demo
. - Protocol: Protocols supported by the website, default is HTTP/HTTPS.
- SSL Certificate Request Method: It is recommended to choose
ServBay CA
, which will automatically generate and manage the SSL certificate. - Website Type: Select
reverse proxy
, specifying that this website accesses the Node.js project via reverse proxy. - IP Address: Enter
127.0.0.1
- Port: Enter the port the Node.js project is listening on, e.g.,
8585
.
Step 6: Complete and Save
After filling in all the necessary information, click the Add
button. ServBay will automatically create the configuration for the new website and make the corresponding settings on the host.
Once saved successfully, you can click the browser icon at the top right to access the website.
Step 7: Quick Actions
ServBay offers a series of quick action buttons for the website, including:
- Open the website with IDE for quick editing
- Open the website in a browser
- View website logs
- Pause, Start the website
- Delete the website
Summary
Adding a Node.js development website in ServBay is a simple and intuitive process. Although ServBay does not currently support the direct addition of Node.js projects, you can still easily add and configure Node.js websites using a reverse proxy. With proper configuration and management, you can ensure your website runs stably in the ServBay environment. If you encounter issues, you can refer to common problems and solutions for troubleshooting and fixing.