Skip to content

A rest api template for to build RESTFul APIs with Node.js + express.js + TypeScript

Notifications You must be signed in to change notification settings

jasondavindev/rest-api-template

Repository files navigation

Rest API Template

This repository is a boilerplate for to build REST APIs with Node.Js, using ExpressJs and TypeScript.

Features

Creating a based project

Creating the project just:

Syntax

generator.sh project-path project-name [git-repository]

./generator.sh /tmp/project my-project

Exit:

Project name is my-project
Target dir is /tmp/project
Target repository is empty
Cloning...
Cloned :D

Run
    cd /tmp/project
    source dev.sh

Creating the project and binding to Git repository:

./generator.sh /tmp/project my-project [email protected]:my-user/my-project.git

Exit:

Project name is my-project
Target dir is /tmp/project/
Target repository is [email protected]:my-user/my-project.git
Cloning...
Initializing repository...
Initialized empty Git repository in /tmp/project/.git/
Cloned :D

Run
    cd /tmp/project/
    source dev.sh

Devhelp

devhelp                Prints devhelp

db_setup               Setup environment

dkbuild                Builds project docker image

pkg_install            Install node packages

dkupa                  Starts docker services in attach mode (at first time, runs pkg_install)

dkupd                  Starts docker services in detached mode (at first time, runs pkg_install)

dk "cmd"               Runs the 'cmd' command inside the container

dkdown                 Stop and remove docker containers