-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
98 lines (91 loc) · 2.31 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
'use strict';
/**
* @module Feature
* @name Feature
* @description A representation of geographical feature of interest(i.e mapped
* physical element with their attributes in landscape e.g. administrative
* boundaries, roads, buildings etc) both natural and man made used in
* emergency(or disaster) management(or event).
*
* @see {@link https://en.wikipedia.org/wiki/Geographic_information_system}
* @see {@link https://tools.ietf.org/html/rfc7946#section-6}
* @see {@link https://wiki.openstreetmap.org/wiki/Features}
* @see {@link https://wiki.openstreetmap.org/wiki/Map_Features}
* @see {@link https://docs.mongodb.com/manual/reference/geojson/}
*
* @author lally elias <lallyelias87@gmail.com>
* @license MIT
* @since 0.1.0
* @version 0.1.0
* @public
* @example
*
* const { app } = require('@codetanzania/emis-feature');
* app.start((error, env) => {...});
*
*/
/* dependencies */
const { pkg } = require('@lykmapipo/common');
const { include } = require('@lykmapipo/include');
const { apiVersion } = require('@lykmapipo/env');
const { app, mount } = require('@lykmapipo/express-common');
const Feature = include(__dirname, 'lib', 'feature.model');
const featureRouter = include(__dirname, 'lib', 'feature.http.router');
/**
* @name info
* @description package information
* @type {Object}
*
* @author lally elias <lallyelias87@gmail.com>
* @since 1.0.0
* @version 0.1.0
*/
exports.info = pkg(
'name',
'description',
'version',
'license',
'homepage',
'repository',
'bugs',
'sandbox',
'contributors'
);
/**
* @name Feature
* @description Feature model
* @type {mongoose.Model}
*
* @author lally elias <lallyelias87@gmail.com>
* @since 1.0.0
* @version 0.1.0
*/
exports.Feature = Feature;
/**
* @name featureRouter
* @description feature http router
* @type {express.Router}
*
* @author lally elias <lallyelias87@gmail.com>
* @since 1.0.0
* @version 0.1.0
*/
exports.featureRouter = featureRouter;
/**
* @name apiVersion
* @description http router api version
* @type {String}
*
* @author lally elias <lallyelias87@gmail.com>
* @since 1.0.0
* @version 0.1.0
*/
exports.apiVersion = apiVersion();
/* export app */
Object.defineProperty(exports, 'app', {
get() {
/* @todo bind oauth middlewares authenticate, token, authorize */
mount(featureRouter);
return app;
},
});