Mailspring/packages/nylas-api/routes/accounts.js

25 lines
555 B
JavaScript
Raw Normal View History

2016-06-19 18:02:32 +08:00
const Serialization = require('../serialization');
module.exports = (server) => {
server.route({
method: 'GET',
path: '/account',
config: {
description: 'Returns the current account.',
notes: 'Notes go here',
tags: ['accounts'],
validate: {
params: {
},
},
response: {
schema: Serialization.jsonSchema('Account'),
},
},
handler: (request, reply) => {
const account = request.auth.credentials;
reply(Serialization.jsonStringify(account));
},
});
};