Skip to content

An example on how to architect, test and develop with Odin

License

Notifications You must be signed in to change notification settings

4odin/cant_driven_development_example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hello_from

An example on how to architect, test and develop with Odin.

We want a REST-API method to meet new friends but block annoying people.

The HTTP method is GET /hello/ and it will have three types of responses:

  • If the person calls the REST-API method for the first time, then the REST-API will respond "Hello, nice to meet you "
  • If the person calls the REST-API method for the second time, but after 60 seconds, then the method will respond with "Hello my friend"
  • If the person calls the REST-API method repeatedly without waiting 60 seconds, then the method will respond with "Get away from me"

Download libraries

git clone https://github.com/laytan/odin-http
git clone https://github.com/rm4n0s/trace

Build

odin build .

Test

 odin test . $> test.log

Run

./hello_from

Call endpoint

$ curl http://localhost:6969/hello/manos
Hello, nice to meet you manos

# after 60 seconds
$ curl http://localhost:6969/hello/manos
Hello my friend

# before 60 seconds
$ curl http://localhost:6969/hello/manos
Get away from me

About

An example on how to architect, test and develop with Odin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Odin 100.0%