This repo demonstrates how to set up an ExpressJS app, deploy it to FL0 and connect it to a database using Sequelize. This app has a single endpoint that will return a random quote and author.
You can find a Quickstart guide for this example repo in FL0's documentation
- NodeJS + NPM installed
- A fork of this repo in your own Github org
- A FL0 project with Postgres database
npm install
to install all dependencies- Rename
.env.example
to.env
and replace theDATABASE_URL
variable with connection details from your FL0 database npm run bootstrap
to set up the database schema and load sample datanpm run start:dev
to run a local server that will automatically reload when you make changes
You will be able to see your app running at http://localhost:3000/
.env
Environment variables that will be loaded into your app at runtime. This is only used for local devsrc/models
Sequelize models for Quotes and Authors are defined in here. The index file dynamically loads the filessrc/scripts
Utility scripts that are called from thenpm run
commandssrc/seeders
Seed files responsible for populating the database with sample datasrc/app.js
The entrypoint for the app, contains the setup for Express and the logic for the routessrc/db.json
The Sequelize configuration file, telling Sequelize how to connect to the DB in different environments
Follow the instructions to connect your repo to FL0. Every time you push a commit to the main
branch, FL0 will build and deploy your app.