CRUD opperation using typescript nodejs express
- clone this repository.
- Open terminal and install the dependencies by using
npm install
or npm i
, install nodemon if not installed globally by writting command npm i nodemon
.
- add
.env
file and provide your mongoose url as MongoCon
and port as PORT
.
- On Terminal write
npx tsc
for build.
- On Terminal write
npm start
for starting the server.
- Now it's ready to use, you can customize the code in
src
folder and build using npx tsc
to see your changes.
Method |
ENDPOINT |
DESCRIPTION |
GET |
/animals |
To get all the dogs info |
POST |
/animals |
To create a new Dog info |
PUT |
/animals/:id |
To update existing Dog info. |
DELETE |
/animals/:id |
To delete the dogs info |
FEILD |
TYPE |
DESCRIPTION |
name |
String |
name of the dog, required |
speceis |
String |
Spicy of the dog, required |
age |
Number |
Age of the Dog, 1means one year 0.1means one month, required |