Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/swag666baby/rpg-crud

a rpg crud
https://github.com/swag666baby/rpg-crud

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

Last synced: about 2 months ago
JSON representation

a rpg crud

Awesome Lists containing this project

README

        



# necessary

## typescript
```
npm install -g typescript
```

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

## examples
**• to create a new user 🖊️**
```typescript
import axios from "axios";

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

**• to modify the coins, rank, name and everything else ✏**
```typescript
import axios from "axios";

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

**• to delete a user 🗑**
```typescript
import axios from "axios";

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

**• to search a user 🔎**
```typescript
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 📃**
```typescript
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/