Skip to content

apsislabs/express_starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

starterapp

Setting up

  1. pull the codebase
  2. bin/rename [your-app-name] # your-app-name should be a npm friendly package name.
  3. rm bin/rename
  4. delete this setting up section of the readme

Optional

Port Changes

The docker-compose maps the server to port 80 on the host. You may want to move it to a different port. Change the port mapping in the following files:

  • docker-compose.yml
  • README.me (just below in the getting started section)

Getting Started

  1. docker-compose up
  2. visit localhost:80
  3. rejoice!

Developing

Connection to the container

bin/ssh_to_container

Running unit tests

From inside the container:

npm test

Connecting to the database

From inside the container run:

ops/psql.sh

Migrations

npm run g:migration [name]

Migrations will automatically be run up to latest on application startup.

To rollback a migration, run in the docker container: npx knex migrate:rollback. To rollback a single step run: npx knex migration:down.

Recommended Reading

The Containers

If you look in docker-compose.yml you'll notice that we've spun up a number of containers, not all of which may be useful for your project.

  1. server: Your core container.
  2. db: A postgres database.
  3. mailcatcher: For viewing emails on your local environment. (disabled by default)
  4. localstack: localstack is a suite of fake AWS services. (disabled by default)
  5. redis: A redis instance. (disabled by default)

Built by Apsis

apsis

express_starter was built by Apsis Labs. We love sharing what we build! Check out our other libraries on Github, and if you like our work you can hire us to build your vision.