1.0.0 • Published 5 years ago

an-api-skeleton v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

An API Skeleton

The project

This is a simple skeleton with an easy structure for developing APIs with Node.js. This project includes the following dependency modules:

  • Express
  • Sequelize
  • bcryptjs
  • JWT

As for development dependencies, the modules are the following:

  • ESLint with Airbnb's defaults
  • Prettier
  • Nodemon
  • Sucrase
  • Sequelize CLI

It also contains a default usersmigration with a basic information.

Configuration

As soon as you install it, modify config/database.js file and choose your preferred database and fill up the credentials.

module.exports = {
  dialect: '[postgres|mysql|mssql|mariadb|sqlite]',
  host: 'localhost',
  username: '',
  password: '',
  database: '',
  define: {
    timestamps: true,
    underscored: true,
    underscoredAll: true,
  },
}

Check Sequelize's Dialects section to know the necessary modules for it to work with your chosen dialect.

Linting

It comes with ESLint and Prettier using Airbnb's code style with a few alterations located in .prettierrc:

{
  "singleQuote": true,
  "trailingComma": "es5",
  "semi": false
}