A progressive Node.js framework for building efficient and scalable server-side applications.
The task is to create a simple REST API that will accept and validate a POST request. The API should validate that:
- Owner is an integer
- Name is an alpha string
- Company is an alphanumeric string
If the requested payload is wrong, the response should throw a generic BAD_REQUEST httpStatus (400). But in the server console, it should throw the actual validation result error.
Screenshoot:

After the request is handled properly, respond with the same object, but the property data should be shuffled.
Screenshoot:

- Nest.js framework
- TypeScript
- Node.js
-
Clone the repository:
git clone https://github.com/example/repo.git -
Install dependencies:
cd sunbytes-codingame && npm install -
Start the server:
npm run start:dev
The server will start on port 3000.
Accepts a JSON object with the following properties:
- owner: integer
- name: string
- company: string
Returns the same object with the data property shuffled.
Example Request:
{
"owner": 12,
"name": "Candidate",
"company": "Sunbytes"
}
Example Response:
{
"owner": 21,
"name": "idCandate",
"company": "Stesunby"
}
Swagger documentation can be accessed at http://localhost:3000/swagger/.
