A dirt simple tiles server for MBTiles files. It can serve image and vector tiles, and multiple MBTiles files can be served.
npm install npm start
List Available Tile Sets
Show Available Meta for Tile Set
Fetch a Tile
index.js contains two variables -
port - the set the directory to find MBTiles files and the server port respectively. The defaults are the server's folder and port 3000.
The Fastify extensions fastify-caching and fastify-cors are used to set tile expiration (in seconds) and CORS. By default, expiration is 48 hours and CORS is set to
access-control-allow-origin: *. See the Fastify projects to learn how to customize those options further.
If you are on Windows and
npm install returns a compilation error, try running
npm install -g windows-build-tools first.
By default, Fastify only listens to requests from
localhost for security reasons. You can change the
host constant in
0.0.0.0 to listen to all IPv4 addresses. See the Fastify listen docs for more details.
This tile server was originally inspired by Christopher Helm's awesome mbtiles-server.