add js examples to gh-pages build

This commit is contained in:
Brandon Liu
2022-10-24 22:24:29 +08:00
parent d689776a18
commit 95b376fcf3
4 changed files with 1 additions and 22 deletions

View File

@@ -24,6 +24,7 @@ jobs:
- run: cd serverless/aws && npm install && npm run build && cp dist/lambda_function.zip ../../app/dist
- run: cd serverless/cloudflare && npm install && npm run build && cp dist/index.js ../../app/dist
- run: cd spec/v3 && cp *.pmtiles ../../app/dist
- run: cd js/examples && cp *.html ../../app/dist/examples/
- name: build_app
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}

View File

@@ -1,22 +0,0 @@
package main
import (
"flag"
"log"
"net/http"
)
func main() {
port := flag.String("p", "7000", "port to serve on")
directory := flag.String("d", ".", "the directory containing PMTiles archives")
flag.Parse()
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Headers", "Range")
http.ServeFile(w, r, r.URL.Path[1:])
})
log.Printf("Serving %s on HTTP port: %s\n", *directory, *port)
log.Fatal(http.ListenAndServe(":"+*port, nil))
}