mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
628654961a
closes #2592 - Add themes browse/read endpoint - Add new permissions for themes (only admin by default) - Add integration tests
37 lines
No EOL
2.2 KiB
JavaScript
37 lines
No EOL
2.2 KiB
JavaScript
var middleware = require('../middleware').middleware,
|
|
api = require('../api');
|
|
|
|
module.exports = function (server) {
|
|
// ### API routes
|
|
// #### Posts
|
|
server.get('/ghost/api/v0.1/posts', api.requestHandler(api.posts.browse));
|
|
server.post('/ghost/api/v0.1/posts', api.requestHandler(api.posts.add));
|
|
server.get('/ghost/api/v0.1/posts/:id', api.requestHandler(api.posts.read));
|
|
server.put('/ghost/api/v0.1/posts/:id', api.requestHandler(api.posts.edit));
|
|
server.del('/ghost/api/v0.1/posts/:id', api.requestHandler(api.posts.destroy));
|
|
server.get('/ghost/api/v0.1/posts/slug/:title', middleware.authAPI, api.requestHandler(api.posts.generateSlug));
|
|
// #### Settings
|
|
server.get('/ghost/api/v0.1/settings/', api.requestHandler(api.settings.browse));
|
|
server.get('/ghost/api/v0.1/settings/:key/', api.requestHandler(api.settings.read));
|
|
server.put('/ghost/api/v0.1/settings/', api.requestHandler(api.settings.edit));
|
|
// #### Users
|
|
server.get('/ghost/api/v0.1/users/', api.requestHandler(api.users.browse));
|
|
server.get('/ghost/api/v0.1/users/:id/', api.requestHandler(api.users.read));
|
|
server.put('/ghost/api/v0.1/users/:id/', api.requestHandler(api.users.edit));
|
|
// #### Tags
|
|
server.get('/ghost/api/v0.1/tags/', api.requestHandler(api.tags.browse));
|
|
// #### Themes
|
|
server.get('/ghost/api/v0.1/themes/', api.requestHandler(api.themes.browse));
|
|
server.put('/ghost/api/v0.1/themes/:name', api.requestHandler(api.themes.edit));
|
|
// #### Notifications
|
|
server.del('/ghost/api/v0.1/notifications/:id', api.requestHandler(api.notifications.destroy));
|
|
server.post('/ghost/api/v0.1/notifications/', api.requestHandler(api.notifications.add));
|
|
server.get('/ghost/api/v0.1/notifications/', api.requestHandler(api.notifications.browse));
|
|
// #### Import/Export
|
|
server.get('/ghost/api/v0.1/db/', api.requestHandler(api.db.exportContent));
|
|
server.post('/ghost/api/v0.1/db/', middleware.busboy, api.requestHandler(api.db.importContent));
|
|
server.del('/ghost/api/v0.1/db/', api.requestHandler(api.db.deleteAllContent));
|
|
// #### Mail
|
|
server.post('/ghost/api/v0.1/mail', api.requestHandler(api.mail.send));
|
|
server.post('/ghost/api/v0.1/mail/test', api.requestHandler(api.mail.sendTest));
|
|
}; |