Giter Site home page Giter Site logo

fumoapi's Introduction

Fumo-api

Introduction

This is the API for the Fumo bot. It is a simple API that returns a random fumo. It is a RESTful API that is built on top of the express framework. It is written in Typescript.

Installation

To install the API, you need to have NodeJS and Yarn installed. You can get them from here.

Once you have NodeJS and yarn installed, you can install the dependencies by running the following command:

# enable corepack for yarn
corepack enable

# install dependencies
yarn install

# start the server
yarn start

Configuration

The API uses environment variables to configure itself. The following environment variables are used:

  • PORT: The port on which the API will listen for requests. Defaults to 3000.

API Documentation

This API has only one endpoint, which is used to get a random fumo image. The endpoint is /random and it accepts a GET request. for browsers, you can simply visit the URL http://localhost:3000/random to get a random fumo.

If you are using a REST client, you can use the Content-Type: application/json header to get a JSON response.

curl -H "Content-Type: application/json" http://localhost:3000/random

The response will be a JSON object with the following structure:

{
  "url": "http://localhost:3000/fumos/0001.jpg"
}

Contributing

If you want to contribute to this project, you can do so by forking the repository and submitting a pull request.

  • For Images, please submit a pull request with the image in the fumos folder.

  • For code, please submit a pull request with the code changes. Please make sure that the code is properly formatted and that the tests pass.

License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.

fumoapi's People

Contributors

miguelmoraesp avatar psykka avatar

fumoapi's Issues

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.