1.0.13 • Published 6 years ago

rest-endpoint v1.0.13

Weekly downloads
3
License
Apache 2.0
Repository
github
Last release
6 years ago

Rest Endpoint

Generate REST CRUD endpoints based on your ORM.

Installation

npm install rest-endpoint --save

yarn add rest-endpoint --save

Configuration

const express = require('express')
const RestEndpoint = require('rest-endpoint')
const app = express()
const models = require('./models')


// Sequelize
const api = new RestEndpoint({
  app,
  sequelize: true,
  namespace: 'api',
})


// Mongoose
const api = new RestEndpoint({
  app,
  mongoose: true,
  namespace: 'api',
})

api.crud(models.channels)
api.crud(models.users)
api.crud(models.conversations)
api.crud(models.messages)

Endpoints

ActionHttp MethodEndpointDescription
ListGET/modelGet a listing of records
ReadGET/model/:idGet details about a record
CreatePOST/modelCreate a record
UpdatePUT/model/:idUpdate a record
DeleteDELETE/model/:idDelete a record

Parameters

Search

Search for String, Integer and Boolean in all your collection.

Route: /model

  • https://.../api/users?search=Lucas
1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago