Skip to content

Commit

Permalink
Merge pull request #2 from fabrix-app/v1.6
Browse files Browse the repository at this point in the history
[feat] Archetype testing
  • Loading branch information
scott-wyatt authored Dec 19, 2018
2 parents dc14710 + f3a930e commit f02d7ad
Show file tree
Hide file tree
Showing 6 changed files with 874 additions and 1,793 deletions.
2 changes: 1 addition & 1 deletion lib/archetype/config/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const events = {
/**
* If Events are enabled
*/
enabled: process.env.EVENTS_ENABLED || true,
// enabled: process.env.EVENTS_ENABLED || true,

/**
* Set profile to subscribe to events, in the matching profile (engine.<type>.profiles).
Expand Down
74 changes: 40 additions & 34 deletions lib/config/routes.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,56 @@
import * as joi from 'joi'
export const routes = {
'/events': {
'GET': 'EventController.findAll',
config: {
prefix: 'events.prefix',
validate: {
query: {
offset: joi.number(),
limit: joi.number(),
where: joi.object(),
sort: joi.array().items(joi.array()),
}
},
app: {
permissions: {
resource_name: 'apiGetEventsRoute',
roles: ['admin']
'GET': {
handler: 'EventController.findAll',
config: {
prefix: 'events.prefix',
validate: {
query: {
offset: joi.number(),
limit: joi.number(),
where: joi.object(),
sort: joi.array().items(joi.array()),
}
},
app: {
permissions: {
resource_name: 'apiGetEventsRoute',
roles: ['admin']
}
}
}
}
},
'/event': {
'POST': 'EventController.create',
config: {
prefix: 'events.prefix',
app: {
permissions: {
resource_name: 'apiPostEventRoute',
roles: ['admin']
'POST': {
handler: 'EventController.create',
config: {
prefix: 'events.prefix',
app: {
permissions: {
resource_name: 'apiPostEventRoute',
roles: ['admin']
}
}
}
}
},
'/event/:id': {
'GET': 'EventController.findOne',
config: {
prefix: 'events.prefix',
validate: {
params: {
id: joi.string().required()
}
},
app: {
permissions: {
resource_name: 'apiGetEventIdRoute',
roles: ['admin']
'GET': {
handler: 'EventController.findOne',
config: {
prefix: 'events.prefix',
validate: {
params: {
id: joi.string().required()
}
},
app: {
permissions: {
resource_name: 'apiGetEventIdRoute',
roles: ['admin']
}
}
}
}
Expand Down
Loading

0 comments on commit f02d7ad

Please sign in to comment.