mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 19:01:08 +00:00
add js examples to gh-pages build
This commit is contained in:
1
.github/workflows/actions.yml
vendored
1
.github/workflows/actions.yml
vendored
@@ -24,6 +24,7 @@ jobs:
|
|||||||
- run: cd serverless/aws && npm install && npm run build && cp dist/lambda_function.zip ../../app/dist
|
- 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 serverless/cloudflare && npm install && npm run build && cp dist/index.js ../../app/dist
|
||||||
- run: cd spec/v3 && cp *.pmtiles ../../app/dist
|
- run: cd spec/v3 && cp *.pmtiles ../../app/dist
|
||||||
|
- run: cd js/examples && cp *.html ../../app/dist/examples/
|
||||||
- name: build_app
|
- name: build_app
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
|||||||
Binary file not shown.
@@ -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))
|
|
||||||
}
|
|
||||||
Binary file not shown.
Reference in New Issue
Block a user