Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/swag666baby/rpg-crud
- Owner: Swag666baby
- Created: 2023-07-14T15:29:09.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-07T17:41:31.000Z (about 1 year ago)
- Last Synced: 2023-12-07T22:38:42.322Z (about 1 year ago)
- Topics: api, bot, crud, crud-api, level, mongodb, mongoose, open-source, ranking, rpg, typescript
- Language: TypeScript
- Homepage: https://rpg-crud-v2b5.onrender.com/
- Size: 18.6 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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/