JSPM

warp-server

5.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 40
  • Score
    100M100P100Q81311F
  • License MIT

Warp Server

Package Exports

  • warp-server

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (warp-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Warp Server

Warp Server is an express middleware that implements an easy-to-use API for managing and querying data from your database.

Currently, Warp Server uses mysql@5.7 as its database of choice, but can be extended to use other data storage providers.

NOTE: This readme is being updated for version 5.0.0. For the legacy version (i.e. versions < 5.0.0), see readme-legacy.md

Table of Contents

Installation

To install Warp Server, simply run the following command:

npm install --save warp-server

Configuration

Warp Server is built on top of express and can be initialized in any express project. To do so, simply add the following configruation to the main file of your project:

// References
import express from 'express';
import WarpServer from 'warp-server';

// Create a new Warp Server API
var api = new WarpServer({
    apiKey: 'someLongAPIKey123',
    masterKey: 'someLongMasterKey456',
    databaseURI: 'mysql://youruser:password@yourdbserver.com:3306/yourdatabase'
});

// Apply the Warp Server router to your preferred base URL, using express' app.use() method
var app = express();
app.use('/api/1', api.router);