This is a little project made for introduce me to the apis development with TypeScript and NodeJS.
- Clone the repository and enter the folder.
-
git clone https://github.com/alnicode/typeorm-rest-api.git
-
cd ./typeorm-rest-api
- Install the dependencies.
npm install
-
Go to db.ts and set the database properties.
-
Now, run the local server.
npm run dev
- Use the route
localhost:3000
to access to the server.
It's all.
You can use npm run build
to compile and generate the .js source and then, npm start
to run the project compiled.
POST: /users
to register a new user.GET: /users
to get all the users.PUT: /users/id
to update an existing user.DELETE: /users/id
to delete an existing user.GET: /users/id
to get an user.
Thanks to Fazt for his dedication and great teachings.