Code Monkey home page Code Monkey logo

titanic-api's Introduction

Titanic Passenger API

Build Status License Quality Gate Status

The Titanic Passenger API is a simple RESTful API built on PHP Lumen.

It provides a simple CRUD interface to interact with the imported passenger data.

API

Display welcome page

curl localhost:8080/api/v1/

Display all passengers

curl localhost:8080/api/v1/passengers

Display passenger id 3

curl localhost:8080/api/v1/passenger/3

Create a new passenger

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"survived":0,"pclass":"3","name":"Dummy","sex":"male","age":12,"siblings_spouses_aboard":1,"parents_children_aboard":0,"fare":7.25}' \
  localhost:8080/api/v1/passenger

Update an existing passenger (id 6)

curl --header "Content-Type: application/json" \
  --request PUT \
  --data '{"survived":0,"pclass":"3","name":"Dummy","sex":"male","age":12,"siblings_spouses_aboard":1,"parents_children_aboard":0,"fare":7.25}' \
  localhost:8080/api/v1/passenger/6

Delete a passenger (id 890)

curl --header "Content-Type: application/json" \
  --request DELETE \
  localhost:8080/api/v1/passenger/890

Docker

Bootstrap the Titanic Passenger API using docker-compose:

Build the containers

docker-compose up --build -d

Run database migrations

docker-compose exec app php artisan migrate --seed

Run integration tests

docker-compose exec app vendor/bin/phpunit

K8s

!! This is largely WIP !!

Change directory

cd resources/docker/kubernetes/

Apply configurations to your k8s cluster

kubectl create -f .

titanic-api's People

Contributors

lusitaniae avatar moretea avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.