Skip to content
This repository has been archived by the owner on Dec 25, 2020. It is now read-only.

A minimal and easy to follow example of what you need to create a CRUD style API in NodeJs using TypeScript

License

Notifications You must be signed in to change notification settings

AElouai/Seans-TypeScript-NodeJS-CRUD-REST-API-Boilerplate

 
 

Repository files navigation

Seans-TypeScript-NodeJS-CRUD-REST-API-Boilerplate

MIT License

Remember, No guarantees, or even fit for a particular purpose.

If you have a suggestion, or you want to contribute some code, you are free to make a pull request.

Your contributions will be visible since this project is public.

Setup

npm install

Development with nodemon and tsc --watch

npm run dev

Then visit http://localhost:3000/cats

Run without nodemon and tsc --watch

npm start

Then visit http://localhost:3000/cats

Swagger

Visit http://localhost:3000/swagger to view the OPENAPI document in Swagger-UI Swagger-UI

Video tutorial on setting up Swagger in an existing NodeJS TypeScript API

Add Swagger-UI Documentation To Existing NodeJS TypeScript API

Continuous Integration and Deployment

I've also added gitlab-ci.yml and dockerised with Docker-Compose. See video tutorial on how all this works. CI/CD a NodeJS API with Docker-Compose and GitLab

Heroku

You can also test this on heroku https://seans-typescript-nodejs-crud.herokuapp.com/cats

and view the Swagger-UI https://seans-typescript-nodejs-crud.herokuapp.com/swagger

Deploy

Usage

List all records

Example Get all records

Post (Create) Record

Example Post (Create) new record

Get by Id

Example Get by ID

Put (Update) Record

Example Put (Update)

Delete Record

Example Delete

TypeScript Socket.IO Course

If you got this far, you probably like TypeScript just like I do, I have created a course to teach TypeScript together with Socket.IO so please check it out.

TypeScript SocketIO Introduction

About

A minimal and easy to follow example of what you need to create a CRUD style API in NodeJs using TypeScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 89.9%
  • Dockerfile 8.6%
  • HTML 1.5%