Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Replace axios with raw fetch API to talk to smuggler from web #69

Merged
merged 5 commits into from Nov 5, 2021

Conversation

akindyakov
Copy link
Contributor

@akindyakov akindyakov commented Nov 3, 2021

Replace axios with raw fetch API to talk to smuggler from web (web app, browser extension, etc).

Basically axios doesn't work in chrome extension, axios GitHub issue axios/axios#2968

  • Replace axios with fetch
  • Replaced axios's CancelToken with fetch's AbortControler all over the truthsayer code
  • Separated archaeologist build in development and production modes - to use different endpoints of smuggler
  • Added simple ping from archaeologist background code to test that smuggler API actually works for it
  • Added special environment variables for archaeologist to distinguish different bowsers in TS/JS code (not used yet)
  • Fixed a problem with cross origin permissions in archaeologist by adding host_permissions to manifest.json

Basically axious doesn't work in chrome extension

- Playground - nothing to look at yet
- Next - chrome,firefox env works now
- Format
- Fixed the problem with env variables to propagate a smuggler URL to an API
- Replace all axious calls with fech - broken now
- Fixed a problem with cross origin traffic in truthsayer
@akindyakov akindyakov force-pushed the archaeologist-authorisation-with-smuggler branch from 6dba24a to 894e6cd Compare November 3, 2021 10:04
@akindyakov akindyakov marked this pull request as ready for review November 3, 2021 10:25
Copy link
Collaborator

@SergNikitin SergNikitin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a small number of questions & suggestions!

README.md Outdated Show resolved Hide resolved
smuggler-api/src/api.test.ts Outdated Show resolved Hide resolved
truthsayer/.env.production Show resolved Hide resolved
truthsayer/src/card/Triptych.js Outdated Show resolved Hide resolved
@akindyakov akindyakov merged commit 667cc0b into main Nov 5, 2021
@akindyakov akindyakov deleted the archaeologist-authorisation-with-smuggler branch November 5, 2021 08:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants