Skip to content

jolienai/unicorn-factory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unicorn-factory

Project structure

/unicorn-factory
    /cmd
        /server     # Main application entry point
    /pkg            # Reusable packages (if any)
    /internal       # Application-specific packages
    /api            # API handlers and route definitions
    /config         # Configuration files
    /db             # Database-related code
    /middleware     # Middleware functions
    /model          # Data models
    /router         # Router setup and middleware registration
    /util           # Utility functions

To request unicorn production

POST http://localhost:8081/v1/unicorn

Body:

{
  "amount": 100
}

The reponse will be an id (number) that can be used to get how the unicorn's production is going

To know how the production is going

GET http://localhost:8081/v1/unicorn/id
[
  {
    "Name": "dim-javier",
    "Capabilities": ["lazy", "cry", "code"],
    "ProducedAt": "2023-09-01T15:03:56.023361Z"
  },
  {
    "Name": "responsible-selma",
    "Capabilities": ["fullfill wishes", "change color", "swim"],
    "ProducedAt": "2023-09-01T15:03:56.988422Z"
  }
]

if passing the header "Response-Type = minimal" you wil get the amount of the unicorn produced until now, so you will know when the prodcution is done when you get the same amount sent in the request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages