I want to develop an APP, what should I do if I don’t have a backend?

I want to develop an APP, what should I do if I don’t have a backend?

[[155146]]

What should I do if I just started a business and only have a front-end but no back-end or the back-end staff has too many tasks?

First, I would think:

How to develop an App quickly? Once the backend is in place and the interface is connected, how to modify the frontend code at the lowest cost?

A common practice is to use test code, test data, etc. in the App.

The disadvantage of this is that a lot of code needs to be modified, and the test path is incomplete. When the backend interface enters formal development, the code has to be modified again.

It would be great if you didn't have to modify any code!

A more convenient and faster development mode is now recommended.

The following URL request does not actually have any background program, but it is consistent with the official environment.

In fact, it just reads a json file and returns the result in the form of Http request.

Local file path:

How is the above achieved?

First, I would like to recommend a very famous software: Nginx. There are corresponding versions for download on Windows, Mac and Linux.

Nginx is a high-performance HTTP and reverse proxy server, and is a good alternative to the Apache server.

[[155147]]

The installation process is omitted here, and the configuration method is mainly provided to everyone.

Step 1: Configure conf file

Default configuration file on Mac: /usr/local/etc/nginx/nginx.conf.default

Just copy the following configuration into it.

  1. server {
  2. listen 8080 ;
  3. server_name localhost;
  4. charset utf- 8 ,gbk;
  5. #access_log logs/host.access.log main;
  6. location ~* {
  7. add_header Content-Type "application/json" ;
  8. root html;
  9. if (!-f $request_filename) {
  10. rewrite ^/(.*) /$ 1 .json last;
  11. }
  12. index index.php index.html index.htm;
  13. }
  14. error_page 405 = 200 http: //$host$request_uri;  
  15. }

Step 2: Add test Json file

Default path on Mac: /usr/local/Cellar/nginx/1.8.0/

The folder can be used as the path of the Http request.

For example, the file path is: /usr/local/Cellar/nginx/1.8.0/html/home/hots.json

The access address is: http://localhost:8080/home/hots.json

Step 3: Additional Notes

The above are all default configurations. You can modify the default configuration file, or modify the specified file path, etc. Please refer to the relevant technical documentation.

<<:  Rumor has it that Alibaba will swallow up Sina and take over Weibo

>>:  The deep logic behind the capital winter: Who is crying "wolf"?

Recommend

How to write the insights section of a promotion plan?

As a creative planner, a core professional qualit...

Whoosh~Eeh? They seemed to smell the "smell" of the universe...

The universe, this mysterious and vast space, alw...

How to quickly increase followers on Xiaohongshu?

Today I want to talk about a hot topic, as the ti...

The boy lit four mosquito coils and was "poisoned". Are mosquito coils so toxic?

Audit expert: Gu Haitong Deputy Chief Physician, ...

Playing bridge, 8 human world champions all lost to AI...

Written by: Yang Xiao Recently, artificial intell...

How can a newbie do live streaming? Complete guide from 0 to 1, save it!

Without further ado, let’s get down to business. ...

Smart Bracelet UP24 Review

Many people will not associate Jawbone UP24 with s...

What are the product methods to improve user retention?

Recently I saw a written test question that requi...

7 taboos for eating mooncakes during the Mid-Autumn Festival that you must know

The Mid-Autumn Festival is approaching faster and...

Why is it bad if the title tag of a web page is too long?

Why is it bad if the title tag of a web page is t...

Mobile and PC management: a difficult but unstoppable path to merger

[[124757]] Obviously, we only jump into a trend w...