]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
examples : update server.py to match github pages app [no ci] (#3004)
authorDaniel Bevenius <redacted>
Fri, 4 Apr 2025 08:23:53 +0000 (10:23 +0200)
committerGitHub <redacted>
Fri, 4 Apr 2025 08:23:53 +0000 (10:23 +0200)
commit0b17d4507e19a7793ff94c820dfea3a49dc942c6
tree30cd8893bcf22dc407223ab42d6a4515447acb12
parent77e0c86ab62eda9392a8567f4c29ab8d140cb0ba
examples : update server.py to match github pages app [no ci] (#3004)

This commit updates examples/server.py which is used to serve the wasm
examples locally. The changes include:

- Added a redirect from the root URL to /whisper.cpp.
  So now accessing http://localhost:8000/ will redirect to
  http://localhost:8000/whisper.cpp/ which matches the url for the app
  deployed to github pages.

- Custom handling for coi-serviceworker.js to serve it to avoid
  and error in the console. This file is not strictly necessary
  for the local server to work as the headers are provided already but
  it is nice to not have an error in the console.

- Fixed the shutdown of the server to ensure it exits cleanly
  on Ctrl+C. Previously it would continue to hang onto the port even
  after the processed had exited.
examples/server.py