1.4.5 • Published 11 months ago

random_word_api v1.4.5

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

Random Word API

The Random Word API is a Node.js application that provides functionality to add words, retrieve random words, and generate random passwords. It can be used in multiple ways: as a standalone application that runs on a server, or by making HTTP requests to the provided endpoints.

Table of Contents

Installation

To use the Random Word API, follow these steps:

  1. Make sure you have Node.js installed on your machine.
  2. Clone the repository or download the source code.
  3. Open a terminal or command prompt and navigate to the project's root directory.
  4. Install the required dependencies by running the following command:
npm i

Usage

Adding Words

To add words to the Random Word API, you can make a GET request to the /addWord/:word endpoint, where :word is the word you want to add.

Example:

GET /addWord/apple

This will add the word "apple" to the list of available words.

Retrieving Words

To retrieve words from the Random Word API, you can make a GET request to the /getWord/:param endpoint, where :param is the parameter value that determines the type of word retrieval.

  • To retrieve a single random word, set :param to 1.

Example:

GET /getWord/1

This will retrieve a single random word from the available words.

  • To retrieve multiple random words, set :param to 2 and provide the number of words you want to retrieve as a query parameter named count.

Example:

GET /getWord/2?count=5

This will retrieve 5 random words from the available words.

Generating Passwords

To generate passwords using the Random Word API, you can make a GET request to the /generatePassword/:length endpoint, where :length is the desired length of the password.

Example:

GET /generatePassword/10

This will generate a random password with a length of 10 characters, consisting of a combination of random words, characters, and numbers.

API Endpoints

The Random Word API provides the following endpoints:

  • GET /addWord/:word: Adds a word to the list of available words.
  • GET /getWord/:param: Retrieves a random word or multiple random words based on the parameter value.
  • GET /getWord/all: Retrieves all random words.
  • GET /generatePassword/:length: Generates a random password of the specified length.
  • GET /generateColor: Generates a random color.

Running the Application

To run the Random Word API application, follow these steps:

  1. Make sure you have completed the installation steps mentioned earlier.
  2. Open a terminal or command prompt and navigate to the project's root directory.
  3. Start the server by running the following command:
npm start
  1. The application will start running on http://localhost:3000. You can now make HTTP requests to the provided endpoints.

Contributing

Contributions to the Random Word API are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License. You can find the license information in the LICENSE

file.

Feel free to customize this documentation template according to your project's specific details and requirements. Include additional information such as examples, error handling, or any other relevant details that may help users understand and utilize your Random Word API.

1.4.5

11 months ago

1.4.4

11 months ago

1.4.3

11 months ago

1.4.2

11 months ago

1.4.1

11 months ago

1.4.0

11 months ago

1.3.9

11 months ago

1.3.8

11 months ago