Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dorian/ce 2635/api abstraction #13

Merged
merged 9 commits into from
Nov 16, 2020
Merged

Conversation

dorianamouroux
Copy link
Contributor

@dorianamouroux dorianamouroux commented Nov 10, 2020

Description

  • New module in src/shared/server to abstract fetching data on the server
  • Use the config module for the staging URL in preview deploy / "staging"
  • Use a local proxy to use staging in development

How it works

import Api from 'shared/api'

// will call /internal/github/codecov/repos/java-standard/?search=hello'
const { data, res } = await Api.get({
  path: '/github/codecov/repos/java-standard/',
  provider: 'gh',
  query: { search: 'hello' }
})

console.log(data) // the body of the response
console.log(res) // the response information like status, headers, etc

@codecov
Copy link

codecov bot commented Nov 10, 2020

Codecov Report

Merging #13 (1d2fc34) into main (b213c32) will increase coverage by 33.87%.
The diff coverage is 84.84%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main      #13       +/-   ##
===========================================
+ Coverage   25.80%   59.67%   +33.87%     
===========================================
  Files           8       11        +3     
  Lines          31       62       +31     
  Branches        2        9        +7     
===========================================
+ Hits            8       37       +29     
- Misses         22       23        +1     
- Partials        1        2        +1     
Impacted Files Coverage Δ
src/pages/Home.js 0.00% <0.00%> (ø)
src/setupProxy.js 0.00% <0.00%> (ø)
src/config.js 100.00% <100.00%> (+100.00%) ⬆️
src/shared/api/api.js 100.00% <100.00%> (ø)
src/shared/api/helpers.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b213c32...1d2fc34. Read the comment docs.

@dorianamouroux dorianamouroux changed the base branch from dorian/CE-2656/config to main November 10, 2020 15:28
@netlify
Copy link

netlify bot commented Nov 10, 2020

Deploy preview for gazebo ready!

Built with commit 1d2fc34

https://deploy-preview-13--gazebo.netlify.app

@dorianamouroux dorianamouroux merged commit d0a30de into main Nov 16, 2020
@dorianamouroux dorianamouroux deleted the dorian/CE-2635/api-abstraction branch November 16, 2020 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants