Ghost/core/server/services/routing/config/v0.1.js
Katharina Irrgang 6b758bda79
Refactored routing config for multiple api versions (#10333)
refs #10124

- one clean v0.1 and v2 config file for routing!
- solves one underlying bug reported in #10124
- the alias handling was just a hotfix to support v2 for the site
- but it was hard to read, ugly
- now we have two clean configs
- we'll see how useful it is
- need to do proper manual testing on Monday
2019-01-04 21:59:39 +01:00

71 lines
1.4 KiB
JavaScript

/* eslint-disable */
module.exports.QUERY = {
tag: {
controller: 'tags',
type: 'read',
resource: 'tags',
options: {
slug: '%s',
visibility: 'public'
}
},
author: {
resourceAlias: 'authors',
controller: 'users',
type: 'read',
resource: 'users',
options: {
slug: '%s',
visibility: 'public'
}
},
user: {
resourceAlias: 'authors',
controller: 'users',
type: 'read',
resource: 'users',
options: {
slug: '%s',
visibility: 'public'
}
},
post: {
controller: 'posts',
type: 'read',
resource: 'posts',
options: {
slug: '%s',
status: 'published',
page: 0
}
},
page: {
controller: 'posts',
type: 'read',
resource: 'posts',
options: {
slug: '%s',
status: 'published',
page: 1
}
},
preview: {
controller: 'posts',
resource: 'posts'
}
};
module.exports.TAXONOMIES = {
tag: {
filter: 'tags:\'%s\'+tags.visibility:public',
editRedirect: '#/settings/tags/:slug/',
resource: 'tags'
},
author: {
filter: 'authors:\'%s\'',
editRedirect: '#/team/:slug/',
resource: 'authors'
}
};
/* eslint-enable */