Skip to content

laradcm/ycit-029-nodejs-assignment

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Details about this YCIT029 assignment

  1. I installed and used joi for data validation, without joi this server will not function, to install it you can use:
    npm i joi

Alternatively you can install all npm packages from my package.json (which will include joi):

    npm i 
  1. The data input format is
    {
        "name": "username",
        "age" : 35
    }

The server attaches the id to the new user automatically, the server will not allow an id to be attached to the json body input

  1. The port chosen for local testing is: 3000, alternatively you may set a preferred PORT using the process.env.PORT variable, this can be done,

using cmd:

set PORT=3333

using powershell:

$env:PORT=3333

using bash/zsh:

export PORT=3333
  1. The id is being generated by randomly picking a number ranging from 1-1000 as long as it has not already been used. Normally this would be generated using uuid, though for the sake of the assignment setup and testing it was kept as integers.

  2. Due to the increased complexity of generating random unique numbers with a higher number of users, this server is limited to a maximum of 15 users.

  3. I used the imsomnia client to test this server and have added my insomnia.json export to this github page for easy testing. Upon importing, the testing methods can be found on the DEBUG section. You can download imsomnia for free at: https://insomnia.rest/download

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%