diff --git a/README.md b/README.md index c39da2e..2d04c06 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The homepage has a tool for generating iframe code for you, with a sensible `san ### V2 -#### GET `/apiv2/feed` +#### GET `/api/v2/feed` > example: `/api/feed?userurl=https%3A%2F%2Foctodon.social%2Fusers%2Ffenwick67&scale=90&theme=light` diff --git a/index.js b/index.js index fe22c01..bb27641 100644 --- a/index.js +++ b/index.js @@ -40,7 +40,7 @@ app.get('/api/feed',cors(),logger,function(req,res){ var userUrl = feedUrl.replace(/\.atom.*/i,''); - var redirectUrl = '/apiv2/feed?'; + var redirectUrl = '/api/v2/feed?'; var qs = ['userurl='+encodeURIComponent(userUrl),"api=v1"]; (['size','theme','boosts','replies']).forEach(key=>{ @@ -53,9 +53,9 @@ app.get('/api/feed',cors(),logger,function(req,res){ }); -app.options('/apiv2/feed',cors()); -// http://localhost:8000/apiv2/feed?userurl=https%3A%2F%2Foctodon.social%2Fusers%2Ffenwick67 -app.get('/apiv2/feed',cors(),logger,function(req,res){ +app.options('/api/v2/feed',cors()); +// http://localhost:8000/api/v2/feed?userurl=https%3A%2F%2Foctodon.social%2Fusers%2Ffenwick67 +app.get('/api/v2/feed',cors(),logger,function(req,res){ // get feed url var userUrl = req.query.userurl; diff --git a/lib/convertv2.js b/lib/convertv2.js index e97a1a6..f39410c 100644 --- a/lib/convertv2.js +++ b/lib/convertv2.js @@ -208,7 +208,7 @@ function getNextPage(opts,user,feed){ // take feed.next, uriencode it, then take user url, then take options.mastofeedUrl var base = opts.mastofeedUrl.slice(0,opts.mastofeedUrl.indexOf('?')); - var ret = '/apiv2/feed?userurl=' + encodeURIComponent(opts.userUrl) + '&feedurl=' +encodeURIComponent(feed.next); + var ret = '/api/v2/feed?userurl=' + encodeURIComponent(opts.userUrl) + '&feedurl=' +encodeURIComponent(feed.next); // add other params to the end (['theme','header','size','boosts','replies']).forEach((k)=>{ diff --git a/static/index.html b/static/index.html index f55a4c2..95a6cca 100644 --- a/static/index.html +++ b/static/index.html @@ -61,7 +61,7 @@