GitHunt
PI

pinceladasdaweb/restify-api

Node.js RESTful API boilerplate using TypeScript, Restify and Mongodb

Restify API

Example of creating an RESTful API using Node.js, TypeScript, Restify, and Mongodb.

Tools

Getting started

# Clone the repository
git clone git@github.com:pinceladasdaweb/restify-api.git myproject
cd myproject

# Install dependencies
npm install

# Start server
# Uses nodemon to watch for changes to Typescript source files
npm start

Database

The server will connect to a database: mongodb://localhost/meat-api.

This setting can be changed in the src/common/environment.ts file.

environment.ts

export const environment = {
  server: { port: process.env.SERVER_PORT || 3000 },
  db: { url: process.env.DB_URL || 'mongodb://localhost/meat-api' },
  security: {
    saltRounds: process.env.SALT_ROUNDS || 10,
    apiSecret: process.env.API_SECRET || 'meat-api-secret'
  },
  log: {
    name: 'meat-api-logger',
    level: process.env.LOG_LEVEL || 'debug'
  }
}

Contributing

Check CONTRIBUTING.md for more information.

History

Check Releases for detailed changelog.

Languages

TypeScript97.7%JavaScript2.3%

Contributors

Created February 10, 2019
Updated June 13, 2024