Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step 2: Create the first routes to return all the information (Ruby) #4

Open
Devopssquadtechire opened this issue Oct 14, 2021 · 0 comments

Comments

@Devopssquadtechire
Copy link
Owner

You will create the following routes :

‘/', which returns the message "Welcome to our schedule website".
‘/users’, which returns the list of users
‘/schedules’, which returns the list of schedules

You can use the curl command to make your http queries from the command line. Of course, you can also make your requests in the browser, but doing it from the command line can help you understand how HTTP requests work. 😉

For example, here is how to make requests (here, Express is configured to listen on port 3000) :

$> curl localhost:3000/users

[{"firstname":"James","lastname":"Bond","email":"james.bond@gmail.com","password":"b6b7fb4cad4bc020f76e16889a8e9065cb708d0f8c304a8a3db609b644da9536"},{"firstname":"Tony","lastname":"Stark","email":"starkrulz@gmail.com","password":"a836ebba36776b21dd0f5cdca497bff65c5bdfc8411cfbfe0111f27bde1c1894"},{"firstname":"Ali","lastname":"G","email":"nameisnotborat@gmail.com","password":"3b5fe14857124335bb8832cc602f8edcfa12db42be36b135bef5bca47e3f2b9c”}]

$>

By default, curl makes GET requests, but we can change this behavior via options (see Step 4).

@Devopssquadtechire Devopssquadtechire created this issue from a note in group1project3a (To do) Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant