Skip to content

DamilolaAlao/TypeScript-Rest-API-with-Express.js-JWT

Repository files navigation

RESTful API using Node.js, Express, Mongoose & TypeScript

This is a boilerplate for building scalable and robust REST APIs using Node.js & TypeScript.

Table of Contents

Prerequisites

You need to install MongoDB either on your local machine or using a cloud service as mLab.

Features

Getting Started

Installation

  1. install the dependencies using npm install or npm i

  2. Rename the file .env.example to .env

  3. Start the app using npm run dev

  4. After that, go to: http://localhost:3658/api/users

Available routes

Method Resource Description
POST /api/users/register Create a new user in the DB. You need to specify in the body the following attributes: firstname, lastname, email & password.
POST /api/users/login Sign in with the email & password. If it's successful, it then generates a token
GET /api/posts Returns the posts

Available scripts

  • dev - To run the app without transpile,
  • start - Build & run the transpiled app

Try in PWD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published