/matrix-operations-api

This API performs various operations on a matrix contained in a CSV file uploaded by the user.

Primary LanguageJavaScript

Matrix Operations API

This API performs various operations on a matrix contained in a CSV file uploaded by the user.

Requirements

Node.js (v12 or higher) npm (v6 or higher)

Installation

Clone the repository: git clone https://github.com/your-username/matrix-operations-api.git Install dependencies: npm install

Usage

Start the server: npm start Send a POST request to the /echo endpoint with a CSV file attached and the desired operation in the op query parameter.

Example Request

```` curl -X POST http://127.0.0.1:8080/echo\?op\=invert -H "Content-Type: multipart/form-data" -F file=@path/to/your/file.csv ````

Available Operations

invert: Inverts the matrix.

flatten: Flattens the matrix to a one-dimensional array.

sum: Calculates the sum of all the elements in the matrix.

multiply: Calculates the product of all the elements in the matrix.

echo (default): Echoes the matrix back as a CSV string.

License This project is licensed under the MIT License. See the LICENSE file for details.