Skip to content

A basic RESTful API with authentication built with Node, Express, TypeScript & MongoDB.

License

Notifications You must be signed in to change notification settings

grigorijtomczuk/backend-api-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend API TypeScript

A basic RESTful API with authentication built with Node, Express, TypeScript & MongoDB.

GitHub Repo Size GitHub License Type

Getting Started

Dependencies

Run this command in the project root to install all dependencies:

$ npm install

MongoDB is another dependency and requires either creating a cloud-based Atlas database or instantiating a local one using MongoDB Community Server.

Configuration

Before starting the server, create .env file in the project root directory and populate it accroding to example.env:

# Port for API to use
PORT=8080

# MongoDB connection string
MONGO_URL=mongodb://127.0.0.1:27017/users

# Secret for updating HMAC content
SECRET=BACKEND-API-TS

Building and Running

The following command will create an optimized production build of the application in the build folder:

$ npm run build

Make sure your MongoDB database is up and running, whether it's local or cloud-based. To run a local instance of MongoDB in the project root directory run this command:

$ mongod --dbpath ./db

To run the application in development mode on your localhost use this command:

$ npm start

License

This project is built under the MIT license.

About

A basic RESTful API with authentication built with Node, Express, TypeScript & MongoDB.

Resources

License

Stars

Watchers

Forks