Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.03 KB

setting_up_a_new_app.md

File metadata and controls

46 lines (32 loc) · 1.03 KB

Setting up a new Mojolicious app

Do you want to get of to a good start on your new Mojolicious application, follow these steps:

  1. Install carton
  2. Create a cpanfile
echo "requires 'Mojolicious';" > cpanfile
  1. Run carton
  2. Setup your application as either app (application) or lite_app (single file application)
# Mojolicious app, defaults to my_app, specify name accordingly
$ carton exec mojo generate app

# Move local/ cpanfile and cpanfile.snapshot into your application folder, please note the below example is the default name
$ mv local/ cpanfile cpanfile.snapshot my_app/
# Mojolicious lite-app, defaults to myapp.pl, specify name accordingly
$ carton exec mojo generate lite_app

And you should be good to go:

# Mojolicious app
$ cd my_app
$ carton exec morbo script/my_app

# Mojolicious lite-app
$ carton exec morbo my_app

Open your browser at:

http://localhost:3000

Start coding and remember to add your requirements to the cpanfile - have fun!