Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Jan 24, 2024
1 parent 7f5cab7 commit 3fb05dd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/guides/mapeo-http-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ Some boilerplate for getting started with a Mapeo project:
// Create Fastify instance
const fastify = Fastify()

// Create FastifyController instance for managing the starting and stopping the Fastify server (handles it more gracefully and allows pausing and restarting)
const fastifyController = new FastifyController({ fastify })

// Create the manager instance (truncated for brevity)
const manager = new MapeoManager({ fastify, ... })

// Start the HTTP server using the controller (awaitable but no need to await in most cases, unless you need to immediately access the HTTP endpoints)
fastifyController.start()
// Start the HTTP server (awaitable but no need to await in most cases, unless you need to immediately access the HTTP endpoints)
fastify.listen()

// (optional) Create FastifyController instance for managing the starting and stopping the Fastify server (handles it more gracefully and allows pausing and restarting)
// This is useful if you are working in a context that needs to pause or restart the server frequently.
// e.g.
// const fastifyController = new FastifyController({ fastify })
// fastifyController.start()

// Create a project
const projectPublicId = await manager.createProject()
Expand Down

0 comments on commit 3fb05dd

Please sign in to comment.