Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Masto = require('mastodon')
- var M = new Masto({
- access_token: process.env.ACCESS_TOKEN,
- timeout_ms: 60*1000, // optional HTTP request timeout to apply to all requests.
- api_url: 'https://yourinstance.com/api/v1/', // optional, defaults to https://mastodon.social/api/v1/
- })
- exports.handler = function(event, context, callback) {
- const {status = ''} = event.queryStringParameters;
- var statusUri = 'statuses/' + status + '/context';
- M.get(statusUri, {}).then(resp =>
- {
- callback(null, {
- statusCode: 200,
- body: JSON.stringify(resp.data.descendants)
- });
- }).catch(e => {
- callback(e);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement