ellie-sleightholm / vercel-rust

This project is a Rust API deployed on Vercel. It is designed for users to build Rust code which can then be called using POST requests. This repository is an easy to use Rust-Vercel API that can be amended for your own requirements.

Home Page:https://vercel-rust-two.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust Vercel API

Introduction

This project is a Rust API deployed on Vercel. It is designed for users to build Rust code which can then be called using POST requests. This repository is an easy to use Rust-Vercel API that can be amended for your own requirements.

Example

There are 3 API calls in the repository and they are outlined below:

  1. A basic indexing call:

    POST https://vercel-rust-two.vercel.app/api/user/[1]
    Content-Type: application/json
    
    {}

    This returns the number received at the end of the url. In this case we have 1.

    [
    1
    ]
  2. A random planet generator.

    POST https://vercel-rust-two.vercel.app/api/simple
    Content-Type: application/json
    
    {}

    This returns a randomly generated planet in our Solar System.

    {
        "message": "I choose the planet, Earth!"
    }
  3. A random planet generator with a specified input.

    POST https://vercel-rust-two.vercel.app/api/complex
    Content-Type: application/json
    
    {
        "name": "Ellie"
    }

    This returns a randomly generated planet in our Solar System.

    {
        "message": "Ellie says: I choose the planet, Uranus!"
    }

Using this Rust API for Your Own Projects

This repository can be cloned and used for your own personal projects. To clone the repository:

git clone https://github.com/ellie-sleightholm/vercel-rust.git

Once cloned, you can use the contents of this repository in your own personal repository. It is important that you have your repository linked to Vercel ready for deployment. Then you're ready to go! Make changes and push to GitHub which will create your own personal URL. You can use this when making POST requests (see here.)

About

This project is a Rust API deployed on Vercel. It is designed for users to build Rust code which can then be called using POST requests. This repository is an easy to use Rust-Vercel API that can be amended for your own requirements.

https://vercel-rust-two.vercel.app


Languages

Language:Rust 100.0%