Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
assert.equal(domain, 'root')
return '/'
},
BriskRoute: {
macro () {},
},
makeSignedUrl (identifier, options, domain) {
assert.equal(identifier, '/signed')
assert.deepEqual(options, {})
assert.equal(domain, 'root')
return '/'
},
}
})
const registrar = new Registrar(ioc)
await registrar.useProviders([join(__dirname, '..', 'providers', 'ViewProvider')]).registerAndBoot()
const view = ioc.use('Adonis/Core/View')
view.registerTemplate('dummy', { template: `{{ route('/', {}, 'root') }}` })
view.registerTemplate('signedDummy', { template: `{{ signedRoute('/signed', {}, 'root') }}` })
view.render('dummy')
view.render('signedDummy')
})
try {
rcContents = esmRequire(join(this.appRoot, '.adonisrc.json'))
} catch (error) {
if (isMissingModuleError(error)) {
throw new Error('Make sure the project root has ".adonisrc.json"')
}
throw error
}
/**
* Setting up the application and binding it to the container as well. This makes
* it's way to the container even before the providers starts registering
* themselves.
*/
this.application = new Application(this.appRoot, ioc, rcContents, pkgFile)
this.registrar = new Registrar(ioc, this.appRoot)
ioc.singleton('Adonis/Core/Application', () => this.application)
return this.application
}
private async _bootProviders () {
const registrar = new Registrar(this.ioc)
/**
* Loads `start/app` file and use providers and aliases from it. In
* case of `intent === ace`, also use `aceProviders`.
*/
const { providers, aceProviders, aliases } = this._loadAppFile()
const list = this._intent === 'ace' ? providers.concat(aceProviders) : providers
/**
* Register all providers
*/
this._providersList = registrar.useProviders(list).register()
this._providersWithExitHook = this._providersList.filter((provider) => typeof (provider.onExit) === 'function')
/**
* Register aliases after registering providers. This will override