Giter VIP home page Giter VIP logo

riddles-api's Introduction

Welcome to the Riddles API

A curated collection of the best riddles out there

A pure-Go API using the database/sql package.

Features:

  • RESTful architecture
  • HATEOAS-driven navigation
  • Error handling
  • Comprehensive non-intrusive logging
  • IP-based access control for selected methods

Available methods

Operation URI Method Status Status Code Availability
All riddles /api/riddles GET OK
Internal Server Error
200
500
public
Random riddle /api/riddles/random GET Success
Internal Server Error
200
500
public
Specific riddle /api/riddles/{id} GET OK
Bad Request
Not found
200
400
404
public
Post riddle /api/riddles POST Success
Bad Request
Internal Server Error
201
400
500
public
Delete riddle /api/riddles/{id} DELETE OK
Bad Request
Not Found
Internal Server Error
Forbidden
200
400
404
500
403
restricted
Update riddle /api/riddles/{id} PATCH OK
Bad Request
Not Found
Internal Server Error
Forbidden
200
400
404
500
403
restricted

Request body example for Update Riddle:

{
  "riddle": "What am I?",
  "solution": "riddle",
  "username": "mr smith", //optional
  "user_email": "[email protected]" //optional
}

Special Methods

Operation URI Method Status Status Code Availability
Riddle with DALLE generated image /api/riddles/images/{id} GET OK
Bad Request
Not Found
Internal Server Error
Forbidden
200
400
404
500
403
restricted

Description:

Generates an image with the riddle as a prompt, and returns the riddle together with the image URL. In the backend, it retrieves the image and stores it in an image table.

Optional request body for additions to the prompt:

{"style": "impressionist"}

riddles-api's People

Contributors

ionutinit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.