Skip to content

A module based implementation of the devwars api, designed to be pulled into a project and easily used.

License

Notifications You must be signed in to change notification settings

DevWars/devwars-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevWars-API-Client


DEV

DevWars API Client

A simple API client to wrap Axios

nodejs version Dependabot Badge

A module-based implementation of the DevWars API, designed to be pulled into a project and easily used.

Getting Started

Prerequisites

Dependency Installation

Run npm install to install dependent node_modules.

Usage

First, you must ensure that the given Axios client is pre-configured with the required base URL and any additional properties required. Since the API will work from the base address and not the full address.

const axiosClient = axios.create({ baseURL: "http://localhost:8080" });
const api = new DevWarsApi(axiosClient);

await api.games.createGame({
  startDate: new Date(),
  season: 3,
  mode: "Classic",
  title: "StarWars Shop",
  status: 3,
  templates: {},
});

Sometimes is important to provide a given value within the body for all valid requests that use it. This can be done by setting the static body on the DevWars client.

DevWarsApi.body = { apiKey: "important-key" };

Contributors

This project exists thanks to all the people who contribute. We encourage you to contribute to DevWars but ensure to open a related issue first. Please check out the contributing to DevWars guide for guidelines about how to proceed.

License

You can check out the full license here

This project is licensed under the terms of the MIT license.

About

A module based implementation of the devwars api, designed to be pulled into a project and easily used.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published