module.exports = { response_400: (res, example, msg) => { res.statusCode = 400; var r = { example_body: example, status: 'Error', code: 400, message: 'Bad request, ' + msg || 'see the example for more information' }; res.send(r); }, response_500: (res, msg) => { res.statusCode = 500; var r = { status: 'Error', code: 500, message: msg }; res.send(r); }, convertToUserObj: (user) => { return { id: user.key.id, username: user.data.username, password: user.data.password, email: user.data.email, creation_time: user.data.creation_time, avatar: user.data.avatar }; }, convertToNoteObj: (note) => { return { id: note.key.id, title: note.data.title, location: { lat: note.data.lat, lng: note.data.lng, address: note.data.address }, body: note.data.body, owner_id: note.data.owner_id, is_public: note.data.is_public, created_at: note.data.created_at, likes: note.data.likes, tags: note.data.tags }; } };