Example app using 5.0.0-preview?

Is there a sample application that’s built with a 5.0.0-preview version somewhere? If so, please share. I’m new to Adonis and often finding myself stumped/lost. e.g. how do I load values from configuration files? I can’t tell if I should be using use (is that even still a thing in 5?), import ... from '@ioc:/something/magical', or something else.

1 Like

Is this related?


Looks like I should be doing import config from './config' in my app code and then maybe I can access data from config/foo.ts via config.get('foo')?

That didn’t work. So far the only way I’ve found is like this:

import { appKey } from '../../../config/app';
console.log('appKey -->', appKey);

but that feels just like the usual, file-based approach, which I thought Adonis did not bless

Shooting from the hip, so I might miss lil bit, but it should be something like this:

import Config from '@ioc:Adonis/Core/Config'
And then use like
Config.get('configfile.key', 'default_value)

1 Like