Skip to content

Commit

Permalink
refactor: use import() instead of import
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaur committed May 23, 2022
1 parent 2990298 commit 1079c47
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import env from '@fastify/env'
import mongodb from '@fastify/mongodb'
import services from './services/index.js'

import * as config from './config.js'

import services from './services/index.js'

export default async function (fastify, opts) {
// fastify-cli does not support loading dotenv with option
await fastify.register(env, config.envOptions)
fastify.register(mongodb, {
await fastify.register(import('@fastify/env'), config.envOptions)
fastify.register(import('@fastify/mongodb'), {
url: fastify.config.MONGODB_URI
})

Expand Down

0 comments on commit 1079c47

Please sign in to comment.