Skip to content

How can I run a function after adonis5 startup #1551

Answered by thetutlage
bstsnail asked this question in Help
Discussion options

You must be logged in to vote

@bstsnail. You can do it using a preload file.

  • Create a new preload file using node ace make:prldfile <name>
  • Make sure you select the web environment or all the environment. DO NOT LEAVE THE PROMPT SELECTION EMPTY.
  • Next write console.log inside the newly created file to check it is getting loaded by AdonisJS automatically.
  • If yes, then you can write any code inside it and it will be executed after the framework is ready

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bstsnail
Comment options

@thetutlage
Comment options

@bstsnail
Comment options

Answer selected by RomainLanz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants