librespeed / speedtest-go

Go backend for LibreSpeed
GNU Lesser General Public License v3.0
700 stars 152 forks source link

Anyway to have the html file run independently from the Go File Server? #26

Open O-Luhishi opened 2 years ago

O-Luhishi commented 2 years ago

Description

Could there be a way to have the index.html file to run independently from the go endpoint/file server. Basically, if I wanted to integrate this into an existing React/Vue project it doesn't seem like it can work. When I run the index.html file by itself using a Python server or React it isn't able to ping the Rest endpoints for /garbage /empty etc. Any chance this is possible?

Why it should be implemented

This would benefit anyone looking to port this project into an already existing React/Vue/Js project.

Thank you!

maddie commented 2 years ago

Sorry for the late reply, been too busy IRL.

I'll see what I can do, or PR is welcomed! :)

maddie commented 2 years ago

I think that you can already use it as a backend only, just point to the endpoints from your custom frontend.

EDIT: The assets folder was designed for custom frontends served by the backend. If you wish to serve your static assets without configuring yet another server (i.e. nginx, Apache), you can just put your custom built frontend assets into the assets folder and have the backend serve them for you.