adamprocter
adamprocter

Getting my timeline with my JSON feed was relatively easy… trying to convert to use my app token / JSON API not getting far.. much more confusing aka I don’t know how I pass token as bearer etc etc.. so for now see the simple feed, when I felt happy 😂

|
Embed
Progress spinner
matthew
matthew

@adamprocter What library you using to make API requests? Here's how I've done it with axios - github.com/matthewro...

|
Embed
Progress spinner
adamprocter
adamprocter

@matthew oh thanks yes axios will take a gander.

|
Embed
Progress spinner
adamprocter
adamprocter

@matthew the current code is all here FYI gitlab.adamprocter.co.uk/adamproct...

|
Embed
Progress spinner
smokey
smokey

@adamprocter 👍

|
Embed
Progress spinner
adamprocter
adamprocter

@matthew appears I have to use POST not GET so off to work that out. Have shoved the start of the webapp online too microcard.adamprocter.co.uk

|
Embed
Progress spinner
vincent
vincent

@adamprocter Let me know if you need help with the MB API. I've been using it A LOT as of late. I can see you are already using Axios - I have a screenshot here on getting mentions from the app I'm building. I set a default "baseURL" on the normal axios instance (the one you import from the library). axios.defaults.baseURL = API_URL;

|
Embed
Progress spinner
adamprocter
adamprocter

@vincent oh cool thank you ! I am a bit stuck moving to the token and using axios POST. For now it just GETs the json feed and I will be trying to use indieauth later. Feel free to make any suggestions / help much appreciated. Code is all here gitlab.adamprocter.co.uk/adamproct... will take a look at your screen shot properly and will have a play on and off today (hopefully)

|
Embed
Progress spinner
adamprocter
adamprocter

@vincent also fyi, @manton added more help on indieauth here help.micro.blog/2019/api-...

|
Embed
Progress spinner
adamprocter
adamprocter

hello @matthew @vincent I have hit a CORS wall at the moment and it seems to suggest that this is due to authorization header being sent (OPTIONS) and so I get stopped by a preflight CORs check which @manton is also looking into however @matthew your electron app appears to be using header authorization too and was not hitting preflight issues? Did you do anything special? stackoverflow.com/questions...

|
Embed
Progress spinner
In reply to
matthew
matthew

@adamprocter Is this in the same repo you linked before? So I can take a look?

|
Embed
Progress spinner
adamprocter
adamprocter

@matthew of course gitlab.adamprocter.co.uk/adamproct...

|
Embed
Progress spinner
matthew
matthew

@adamprocter The issue is CORS on the micro.blog API, electron doesn't have the same pre-flight requests as a browser that's why my App gets past it. Manton will need to open the API up for CORS

|
Embed
Progress spinner
adamprocter
adamprocter

@matthew thanks that’s the conclusion I had drawn will wait and see what @manton can do thanks for taking a look too

|
Embed
Progress spinner
vincent
vincent

@adamprocter Hey Adam. Yep @matthew is correct. It’s the API side of things.

|
Embed
Progress spinner
adamprocter
adamprocter

@vincent 👍

|
Embed
Progress spinner