Nodejs how to create server? ? ? Configure the service? ? ? You need to refer to third-party frameworks? ? ? Simple to use framework to build express service node

1. First you have to download nodejs official website and configure npm source, click the relevant connection to view
2. Familiarize yourself with the disk to create a new empty folder, here I am building a project folder in the e drive, and in the address bar or cmd windows + r shortcut to open the Run window, type cmd, and then entering the newly created empty folder

Here Insert Picture Description

3. Then we start configuring our Nodejs service, enter the command line window tool npm install express --save install third-party frameworks express

Install third-party frameworks
To see if there is a successful installation folder express
Here Insert Picture Description

4. Then pull the file into the editor to edit the file and create a file we need to use in, I use here is vsCode

-I. Introduction express framework to express instantiate, monitor and create a service
Here Insert Picture Description
-ii. After the service configuration is successful, we want to show the written page (here I created a new file in the project views view files created in this file the default index.html page, error page error.html, details page info.html), and scripting
Here Insert Picture Description
-iii enter the access port number in the browser, configure the service access port number localhost:. 5000, then they have to enter specific access page
Here Insert Picture Description

nodejs a simple configuration service has been successful, think of it, is not very simple

Published 15 original articles · won praise 1 · views 10000 +

Guess you like

Origin blog.csdn.net/NanQiao1716/article/details/104580010