equipped v5.0.0-rc.10
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:
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)
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 months ago
5 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago