Git Product home page Git Product logo

api's Introduction

api

Build Status

Optly web api

Getting Started

Migrations

Before you build and run the application, make sure postgres is installed and running.

Start the postgres docker container:

  docker run -e POSTGRES_PASSWORD=mysecretpassword -p 15432:5432 -d postgres

Migrate the database to latest schema version:

  lein migrate

Build

Once you have cloned the repo and have installed leiningen.

Run:

  lein ring server

In order to launch locally.

Testing

We use leiningen for testing.

Run:

  lein test

Docker Deployment

Postgres

Start the postgres docker container

  docker run --name optylist-api-db -e POSTGRES_PASSWORD=mysecretpassword -d postgres

Migrations

Run the migrations against the postgres database

  docker run -e "JDBC_DATABASE_URL=jdbc:postgresql://optylist-api-db:5432/postgres?user=postgres&password=mysecretpassword" \
    --link optylist-api-db:optylist-api-db optylist/api migrate

Server

Start the application server

  docker run -e "JDBC_DATABASE_URL=jdbc:postgresql://optylist-api-db:5432/postgres?user=postgres&password=mysecretpassword" \
    --link optylist-api-db:optylist-api-db -p 4000:3000 -d optylist/api

License

Copyright © 2017 John McConnell

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

api's People

Contributors

bkenny1123 avatar johncoleman83 avatar johnmcconnell avatar

Stargazers

 avatar

Watchers

 avatar  avatar

api's Issues

docker migration command not correct

This was my terminal output:

$ docker run -e "JDBC_DATABASE_URL=jdbc:postgresql://optylist-api-db:5432/postgres?user=postgres&password=mysecretpassword" --link optylist-api-db:optylist-api-db optylist-api migrate
Unable to find image 'optylist-api:latest' locally
docker: Error response from daemon: repository optylist-api not found: does not exist or no pull access.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.