GithubHelp home page GithubHelp logo

swag666baby / rpg-crud Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 2.0 19 KB

a rpg crud

Home Page: https://rpg-crud-v2b5.onrender.com/

TypeScript 100.00%
api bot crud crud-api level mongodb mongoose open-source ranking rpg typescript

rpg-crud's Introduction

necessary

typescript

npm install -g typescript

running

git clone https://github.com/Swag666baby/rpg-crud
cd rpg-crud 
yarn
npm run build
npm start

examples

โ€ข to create a new user ๐Ÿ–Š๏ธ

import axios from "axios";

const newUser = async() => {
    const post = await axios.post("http://localhost:3000/register", 
    {
        "id": "<randomId>",
        "name": "<userName>",
        "class": "<youClass">,
        "primary_weapon": "<youPrimaryWeapon>",
        "secondary_weapon": "<youSecondaryWeapon>"
    })
    console.log(post.data)
}

โ€ข to modify the coins, rank, name and everything else โœ

import axios from "axios";

const newNameUser = async() => {
    const post = await axios.post("http://localhost:3000/modify", {"id": "<youId>", "name": "<newNameUser>"})
    console.log(post.data)
}

โ€ข to delete a user ๐Ÿ—‘

import axios from "axios";

const deleteUser = async() => {
    const post = await axios.post("http://localhost:3000/delete", {"id": "<youId>"})
    console.log(post.data)
}

โ€ข to search a user ๐Ÿ”Ž

import axios from "axios";

const searchUser = async() => {
    const request = await axios.get("http://localhost:3000/search?id=youId")
    console.log(request.data)
}

โ€ข to have a view of all registered users ๐Ÿ“ƒ

import axios from "axios";

const allUsers = async() => {
    const request = await axios.get("http://localhost:3000/")
    console.log(request.data)
}

Some items are changed automatically, so I chose not to allow modification via the modify route. items like xp, level and patent. but if you still want to change them via route, go to src/routes/modifyUsers.ts and add them to newData.

https://rpg-crud-v2b5.onrender.com/

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.