The configure() function is declared in configure.swift. Services are set up in configure() before your application initializes:
// File: /Sources/App/configure.swift
import FluentSQLite
import Vapor
/// Called before your application initializes.
public func configure(_ config: inout Config, _ env: inout Environment, _ services: inout Services) throws {
/// Register providers first
try services.register(FluentSQLiteProvider()) // [1]
/// Register routes to the router
let router = EngineRouter.default()
try routes(router)
services.register(router, as: Router.self) // [2]
/// Register middleware
var middlewares = MiddlewareConfig() // Create _empty_ middleware config
/// middlewares.use(FileMiddleware.self) // Serves files from `Public/` directory
middlewares.use(ErrorMiddleware.self) // Catches errors and converts to HTTP response
services.register...