How does it work?

The AMI is designed in such a way that you only need to deal with one folder: /var/www/webapp. That folder will contain all your configuration files and your source code.

This is how the /var/www/webapp/ folder of your AMI should look like when you launch it:

├── conf
│   ├── autorun.sh
│   ├── cron
│   │   ├── d
│   │   ├── daily
│   │   ├── hourly
│   │   ├── monthly
│   │   └── weekly
│   ├── global
│   │   ├── hostname
│   │   └── timezone
│   ├── mail
│   │   ├── msmtprc
│   │   └── notifications
│   ├── netdata
│   │   ├── netdata.conf
│   │   ├── password
│   │   └── stream.conf
│   └── nginx
│       ├── helloworld.crt
│       ├── helloworld.key
│       ├── netdata.conf
│       └── web.conf
└── src
    ├── app.js
    ├── bin
    │   └── www
    ├── node_modules
    ├── package-lock.json
    ├── package.json
    ├── public
    │   └── stylesheets
    ├── routes
    │   ├── index.js
    │   └── users.js
    ├── views
    │   ├── error.jade
    │   ├── index.jade
    │   └── layout.jade
    └── yarn.lock

You can check the contents of our ExpressJS demo project

Let’s start with the more obvious part, the src folder. This is the usual ExpressJS folder structure. If you have used ExpressJS before, the folder structure should look very familiar.

That said, let’s move on to the conf folder. That folder contains the configuration files for each service. You’ll be able to edit the behavior of all the services from here, without having to edit anything else. Just apply your changes and restart the services using the usual systemd commands or the additional CLI tools provided with this AMIs.