This moves the public "get an import" interface from HTTP to JavaScript. In other words, you won't make an HTTP GET to /import/:importId any more. Instead, you'll call server.getImport(importId).
This is the first step in a larger refactor, where most of the interface will be moved from HTTP to JS. Because this is the first step, several changes have to be made:
createMapServer returns a newly-created MapServer instance, rather than a FastifyInstance. This instance is the main public interface.
MapServer takes on many of the responsibilities of Api, such as initializing the database and dealing with server shutdown.
Tests need to work a bit differently. Those in the "new style" deal with the MapServer instance where those in the "old style" deal with the Fastify instance.
Update documentation.
I suspect future moves, such as migrating GET /styles, will be much smaller patches.
BREAKING CHANGE: GET /imports/:importId replaced with getImport()
This moves the public "get an import" interface from HTTP to JavaScript. In other words, you won't make an HTTP GET to
/import/:importId
any more. Instead, you'll callserver.getImport(importId)
.This is the first step in a larger refactor, where most of the interface will be moved from HTTP to JS. Because this is the first step, several changes have to be made:
createMapServer
returns a newly-createdMapServer
instance, rather than aFastifyInstance
. This instance is the main public interface.MapServer
takes on many of the responsibilities ofApi
, such as initializing the database and dealing with server shutdown.MapServer
instance where those in the "old style" deal with the Fastify instance.I suspect future moves, such as migrating
GET /styles
, will be much smaller patches.BREAKING CHANGE:
GET /imports/:importId
replaced withgetImport()