Coder Social home page Coder Social logo

postie-api's Introduction

Build Status Docker Build Status

Postie (API)


Postie is an in-development RESTful API for a plain text hosting service.

Getting Started

Installation/Usage

Docker Compose

The easiest way to run the Postie API is using the docker-compose.yml file within the root directory.

docker-compose up

This command will initialize a PostgreSQL database with the Postie schema and start up the API.

The default database credentials, API key and ports can be overridden using the environment variables within this file.

Docker

The api folder contains a Dockerfile that can be used to build a Docker image of the Postie API.

cd api/
docker build -t bornylsdeen/postie . 

Alternatively, you can pull down and use a pre-built image from the Docker Registry.

docker pull bornylsdeen/postie

You can then run the image pointing it towards a PostgreSQL database that has been setup with the Postie database schema (see database/init.sql).

docker run \
  --env POSTIE_PORT=7000 \
  --env POSTIE_API_KEY=postie \
  --env POSTIE_POSTGRES_HOST=jdbc:postgresql://localhost \
  --env POSTIE_POSTGRES_PORT=5432 \
  --env POSTIE_POSTGRES_USER=postie \
  --env POSTIE_POSTGRES_PASSWORD=postie \
  -d \
  bornylsdeen/postie

Java

If you want to run the Postie API outside of Docker you can create a fat JAR using the shadowJar gradle task.

The Postie API has only been tested against Java 1.8

cd api/
./gradlew shadowJar

You can then start up the API using the run command and configure it using the command-line options (environment variables will also work here but the command-line options take precedence).

java -jar /build/libs/api-0.0.1-all.jar run \
  --port 7000 \
  --api-key postie \
  --postgres-host jdbc:postgresql://localhost \
  --postgres-port 5432 \
  --postgres-user postie \
  --postgres-password postie

postie-api's People

Contributors

b-reynolds avatar

Stargazers

Troy Rijkaard avatar

Watchers

James Cloos avatar

postie-api's Issues

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.