DEV Community

PokeAPI REST in NodeJS with Express, Typescript, MongoDB and Docker — Part 2

Nya on July 11, 2019

Foreword This is part 2 of a series of posts which will show you how to create a RESTful API in NodeJS. For further reading please che...
Collapse
 
baterka profile image
Baterka

Where should be input data validation? I see you not made any:
in addNewPokemon: const newPokemon = new Pokemon(req.body); isn't excatly safe because we can put anything into body and it will fail when persisting into DB.
I am trying to find out good way to split logic...