This is an erlang application created to show up a way of use of the cowboy web server.
It allows to:
- Register user on a server from JSON:
http://localhost:8080/register - Authenticate user from JSON:
http://localhost:8080/login - Authorize user from JWT(from cookie), for all the methods below.
- List users:
http://localhost:8080/users - Get user (retrieving id from url):
http://localhost:8080/users/1 - Update password from JSON:
http://localhost:8080/update_password
cowboy_host- web-server host;cowboy_port- web-server port;secret- secret for JWT generation;pools- several options for managing pool of connections to mariadb
- check .env, sys.config.src file to set needed configuration parameters
- run:
docker-compose up --build --force-recreate --no-deps
- or build and run:
docker-compose builddocker-compose up
- check sys.config file to set needed configuration parameters;
- make sure you have mariadb running on configured host/port;
- run ./sql/init_db.sql script in appropriate db for tables initialization;
- run
rebar3 as local shell
- or build and run
rebar3 as local release_build/local/rel/cowboy_rest_example/bin/cowboy_rest_example console|foreground
cd manual_tests && ./all.sh localhost