How to run an Elixir application?

后端 未结 2 2043
执念已碎
执念已碎 2021-01-30 19:17

What is the correct way to run an Elixir application?

I\'m creating a simple project by:

mix new app

and after that I can do:



        
2条回答
  •  悲&欢浪女
    2021-01-30 19:57

    You can run tasks by importing Mix.Task into your module instead of mix run.

    I think this is what you're looking for.

    On top of that, instead of mix , you can simply run mix to run the default task. Simply add default_task: "bot.run" into the list of def project do [..] end in mix.exs. Refer here.

提交回复
热议问题