Skip to content

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

Notifications You must be signed in to change notification settings

pinceladasdaweb/restify-api

Repository files navigation

Restify API

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

Tools

Getting started

# Clone the repository
git clone [email protected]: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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published