Get the App
SLTechnology News&Howtos  ›  Servers  › 

Quickly build your own server in one minute

Shulou Source: shulou.com Published: 2022-06-02 07:40:54 09月16日 Update

When doing mobile applications, the localhost address generated by the local server cannot be opened on the mobile side, so we also need a reverse proxy. Let's talk about how to quickly build a server of our own.

1. Local server

Local servers can be generated in many ways, using automated build tools such as grunt,glup,webpack, and so on. You can also use nodejs. Here's a general way: http-server.

Npm install-g http-server / / Global installation of http-server

one

Http-server / / run http-server

one

An address of localhost will be generated

Enter localhost:8080 in the browser to open the local page.

Of course, linux users can also use the simpler python to build.

two。 Reverse proxy

We do not choose the method of generating the public key as described on the official website. We first select the corresponding version to download to the project, then run ngrok.exe, and enter:

Ngrok http 8080 / / use the port number generated by the corresponding local server

one

A URL is generated as follows:

In this way, we can open the URL to view the page in the browser of any device.

The disadvantage of this approach is that it needs to be regenerated after each disconnect, and the address is not unique, but it is more convenient and quick for you to debug the project.

Tags: Build server service method address browser URL page project agent browse move input run select convenient and fast global public key slogan that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker NVidia macOS Huawei Apple