Skip to content

An Elixir implementation of "Get A Job" service from "Designing Hypermedia APIs".

License

Notifications You must be signed in to change notification settings

smoynes/get_a_job_ex

Repository files navigation

GetAJob in Elixir

An Elixir implementation of the "Get a Job" service from Designing Hypermedia APIs by Steve Klabnik.

The application uses the Phoenix Framework to implement the API.

This is a work in progress and not complete.

Development

Requirements:

  • postgresql: server and client
  • Erlang/OTP 17
  • Elixir 1.0.4

I've built a vagrant environment that has everything you need:

$ vagrant up
$ vagrant ssh

The source code is available in the VM at /vagrant.

To run the application in development mode.

  1. Install dependencies:

    $ ./scripts/build.sh
    

    Or, equivalently:

    $ mix local.hex --force
    $ mix local.rebar --force
    $ mix deps.get
    $ npm install
    
  2. Create the databases:

    $ ./scripts/create_db.sh
    

    Or, equivalently:

    $ mix ecto.create
    $ mix ecto.migrate
    
  3. Start Phoenix endpoint:

     $ mix phoenix.server

Now you can visit http://localhost:4000 from your browser. The port is also forwarded to the vagrant VM.

Examples

$ curl -L --include \
  --data 'job[status]=in_progress' \
  --data 'job[number_one]=5' \
  --data 'job[number_two]=2' \
  http://127.0.0.1:4000/api/jobs
$ curl --include http://127.0.0.1:4000/api/jobs/1
$ curl http://127.0.0.1:4000/api/jobs

About

An Elixir implementation of "Get A Job" service from "Designing Hypermedia APIs".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published