Skip to content

ô de casa - REST API with attendance status at Raul Hacker Club -

License

Notifications You must be signed in to change notification settings

ielson/ohDeCasa-rhc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ô de casa - RHC

Para ler esse texto em pt-br, use esse link.

Introduction

This project aims to be a REST API, that logs and show info about usage of Raul Hacker Club space.

Prerequisites

The prerequisites to use this project are:

A client capable of HTML requisitions, as GET and POST. The recommended service is cURL a simple and lightweight command line tool for transfering data to a server, but if you just want to use the GET requisitions a web browser like firefox is enough.

Besides that, we'll also need python and flask installed. If you need help installing these, the best place are the projects' installing page.

How to use

The first step is to run flask with our project, to do so, go to the clonec repo path and run: export FLASK_APP=ohDeCasa-api.py followed by flask run

Status

To know which members are at RHC in these moment, run the following comand:

curl localhost:5000/status

the result will be a json containing the users at the space and a field called isOpen, showing wheter the place is available for visits or not.

Check-in

If an user arived at the Hacker Club and wants to show others he is there, he just needs to use the checkin endpoint with his user name. For the checking-in the user ielson, it's just to run this command:

curl -H "Content-type: application/json" -d "{\"user\":\"ielson\"}" localhost:5000/checkin

resulting in checked-in user and check-in time.

Check-out

The check-out function works works reversing what the check-in function does, and it's syntax are the same, you just need to pass the user name to checkout endpoint, like this:

curl -H "Content-type: application/json" -d "{\"user\":\"ielson\"}" localhost:5000/checkout

About

ô de casa - REST API with attendance status at Raul Hacker Club -

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages