Front-end access to back-end static files directly

background

There are some fixed files that the front end needs to access. The first solution is to put it in the file center, but the file center will have an automatically generated file name, and the front-end direct access cannot replace the original file name. So I thought of another solution, put the file in the project directory, and let the front end directly access it.

 achieve

In the resource directory, create a new static directory, create a new file directory in the static directory, and then the front end can directly access the files in the file directory

Front-end access path: localhost:8080/file/test.txt 

Borrow

Access files through url (static resources)

Guess you like

Origin blog.csdn.net/yxz8102/article/details/108499933