I will provide an API to generate characters attributes for Dungeons and Dragons RPG.
By default, the application is running on port 1337
. You can change the port in the file .env
.
For exemple, to generate scores using the rule 4d6 use the endpoint http://localhost:1337/attributes/4d6.
❗ Important
The Frontend only works IF the backend is initialized!
- Clone this repository
git clone [email protected]:tufcoder/dnd-api.git
. - In your terminal, access the folder
~/dnd-api/backend
. - Type
npm i
to install/update the dependencies; - Start the server, type
npm run dev
and await the messageServer is running
. - Open another terminal, access the folder
~/dnd-api/frontend
and execute the step 3. - Start the app with
npm run dev
and await from the Vite local address, something likehttp://localhost:5173/
. - Click in one button to generate the ability scores using the backend API.
- Generates new attributes and returns the scores
- Parameters:
- maximum_attributes
- Must be a value between 1 and 6
- minimal_score
- Must be a value between 3 and 18
- maximum_attributes
- Endpoints:
- /attributes/4d6
- /attributes/1d10plus8
- /attributes/1d8plus10
- /attributes/3d6
- Recover the scores generated by the POST routes
- Endpoint:
- /attributes
Launch the application and access the URL:
- NodeJS
- Express
- TypeScript
- React
That's a simple app to test the API endpoints.