Let's go over some basic usage.
- Getting Started
- Starting Your Site
- Advanced Service Usage
- Read More
Before you get started with this recipe we assume that you have:
If after reading #2 above you are still unclear how to get started then try this
# Go into a local folder with your site or app codebase # You can get this via git clone or from an archive cd /path/to/my/codebase # Initialize a basic .lando.yml file for my recipe with sane defaults lando init # Commit the .lando.yml to your git repo (Optional but recommended) git add -A git commit -m "MAKE LOCAL DEV GREAT AGAIN" git push
For more info on how
lando init works check out this.
Once you've completed the above you should be able to start your MEAN site.
# Install dependencies your app needs to run lando npm install || lando yarn install # Start up app lando start
If you visit any of the green-listed URLS that show up afterwards you should be presented with whatever content is loaded by the
main script in your
Each MEAN recipe will also ship with some helpful
node dev utilities. This means you can use things like
npm via Lando and avoid mucking up your actual computer trying to manage
node versions and global
If you are interested in installing other helpful global
node commands like
gulp we recommend you read our Setting up front end tooling guide.
lando mongo Drop into the mongo shell lando node Run node commands lando npm Run npm commands lando yarn Run yarn commands
# Drop into a mongo shell lando mongo # Install the redis module lando npm install redis --save # Install wahts in my package.json with yarn lando yarn install # Run a node command lando node -e "console.log('hi');"
You can also run
lando from inside your app directory for a complete list of commands.
You can also manually configure the
.lando.yml file to switch
mongo versions, set a custom
npm start to run when you start your app or to use a custom
mongo config file.
# MEAN recipe example name: mean # Start with the default MEAN recipe recipe: mean # Configure the MEAN recipe config: # Specify the command you want to run to start up your node appserver # # If unspecified this will run `npm start` command: npm start # Optionally specify the node version to use. # # If ommitted this will default to the node LTS 6.10. Consult the `node` # service to see what versions are available # # NOTE: that this needs to be wrapped in quotes so that it is a string node: '8.0' # Optionally specify the node version to use. # # If ommitted this will default to the mongo LTS 3.4. Consult the `mongo` # service to see what versions are available # # NOTE: that this needs to be wrapped in quotes so that it is a string mongo: '3.2' # Optionally specify global dependencies you need a la gulp-cli. # # NOTE: you will need to make sure you add tooling routes for these if applicable globals: gulp-cli: "latest" # Optionally mix in our own config files # # If ommitted this will use the default config files for the respective services. # Definitely consult the relevant documentaion for each service to make sure # you are specifying the correct value for the config. # conf: # database: mongo.yml tooling: gulp: service: appserver
You will need to rebuild your app with
lando rebuild to apply the changes to this file. You can check out the full code for this example over here.
Lando will add some helpful environment variables into your
appserver so you can get database credential information. These are in addition to the default variables that we inject into every container.
These are in addition to the default variables that we inject into every container.
You can take advantage of Lando's events framework to automate common tasks. Here are some useful examples you can drop in your
.lando.yml to make your MEAN app super slick.
events: # Runs yarn install after you start your app post-start: - appserver: cd $LANDO_MOUNT && yarn install
You can get more in-depth information about the services this recipe provides by running
- Using Composer to Manage a Project
- Lando and CI
- Lando, Pantheon, CI, and Behat (BDD)
- Killer D8 Workflow with Platform.sh