4.4.6 • Published 26 days ago

equipped v4.4.6

Weekly downloads
-
License
ISC
Repository
github
Last release
26 days ago

Equipped

Installation

This is a Node.js module available through the npm registry. Before installing, download and install Node.js. Node.js 4.2.4 or higher is required. If this is a brand new project, make sure to create a package.json first with the npm init command. Installation is done using the npm install command:

Using npm:

npm install equipped

Using yarn:

yarn add equipped

Using CDN:

Equipped jsDelivr CDN

Basic Usage

Before use, the package must be initialized in the entry point into your application, with the required settings.

import { Instance } from 'equipped'

Instance.initialize({
    isDev: true, // Are you running in a dev environment
    appId: 'testing', // An id to identify your application
    mongoDbURI: 'mongodb://...', // A mongodb url if you want to use a database
    redisURI: 'redis://localhost:6379', // A redis url if you want to use a redis cache. Confirm all other functionality you intend to use do not depend on the cache, even if you are not using a cache directly
    ...other settings
})

After the app has been initialized, the Instance class returns a singleton that provides access to most functionality provided by Equipped

import { Instance } from 'equipped'

const appInstance = Instance.get()

To start a server

import { makeController, StatusCodes } from 'equipped'

// Aggregate all your routes into an array. This can be defined in the file or imported from your controllers etc
appInstance.server.routes = [
    {
        path: '/',
        method: 'get',
        controllers: [makeController(async () => {
            return {
                result: 'Hello world',
                status: StatusCodes.Ok
            }
        })]
    }
]

await appInstance.server.start(8080)
4.4.5

26 days ago

4.4.6

26 days ago

4.4.4

1 month ago

4.4.3

2 months ago

4.4.2

2 months ago

4.4.1

2 months ago

4.4.0

2 months ago

4.3.2

2 months ago

4.3.1

3 months ago

4.3.0

3 months ago

4.2.9

3 months ago

4.2.10

3 months ago

4.2.8

5 months ago

4.2.7

5 months ago

4.2.6

5 months ago

4.2.3

6 months ago

4.2.2

6 months ago

4.2.5

5 months ago

4.2.4

6 months ago

4.2.1

8 months ago

4.2.0

8 months ago

4.1.19

9 months ago

4.1.20

9 months ago

4.1.21

9 months ago

4.1.22

8 months ago

4.1.23

8 months ago

4.1.18

9 months ago

4.1.16

12 months ago

4.1.17

11 months ago

4.1.11

1 year ago

4.1.12

1 year ago

4.1.13

1 year ago

4.1.14

1 year ago

4.1.15

12 months ago

4.1.10

1 year ago

4.1.9

1 year ago

4.1.8

1 year ago

4.0.2-alpha.4

1 year ago

4.1.7

1 year ago

4.1.6

1 year ago

4.1.5

1 year ago

4.1.4

1 year ago

4.1.3

1 year ago

4.1.2

1 year ago

4.1.1

1 year ago

4.1.0

1 year ago

4.0.2-alpha.3

1 year ago

4.0.2-alpha.2

1 year ago

4.0.2-alpha.1

1 year ago

4.0.2

1 year ago

4.0.1

1 year ago

4.0.0-alpha-10

1 year ago

4.0.0-alpha.9

1 year ago

4.0.0-alpha.8

1 year ago

4.0.0-alpha.7

1 year ago

4.0.0-alpha.6

1 year ago

4.0.0-alpha.5

1 year ago

4.0.0-alpha.4

1 year ago

4.0.0-alpha.3

1 year ago

4.0.0-alpha.2

1 year ago