Skip to content

Commit

Permalink
chore: Change API domain name
Browse files Browse the repository at this point in the history
  • Loading branch information
kevee committed Aug 5, 2020
1 parent 110aa45 commit f3b7f37
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/components/common/summary-charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ export default ({ name = 'National', history, usHistory, annotations }) => {

[usHistory, usePerCap, sliceStart, sliceEnd],
)
// TODO: These two state exemptions should be removed after they reach 30 days of
// hospitalization data. That or we should rethink this requirement. -goleary
// TODO: These two state exemptions should be removed after they
// reach 30 days of hospitalization data. That or we should
// rethink this requirement. -goleary
const hasData = field =>
name === 'Hawaii' ||
name === 'Florida' ||
Expand Down
8 changes: 5 additions & 3 deletions src/components/pages/data/api/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import explorerStyles from './explorer.module.scss'
import definition from '../../../../../_api/v1/openapi.json'

const PreviewUrl = ({ path, format, parameters }) => {
let examplePath = path.replace('{format}', format)
let examplePath = path.replace('{format}', format).replace('/api/', '/')
parameters.forEach(parameter => {
if (parameter.name !== 'format') {
examplePath = examplePath.replace(
Expand All @@ -23,12 +23,14 @@ const PreviewUrl = ({ path, format, parameters }) => {
return (
<>
<p className={explorerStyles.pathDescription}>
<code>{path.replace('{format}', format)}</code>
<code>{path.replace('{format}', format).replace('/api/', '/')}</code>
</p>
<p className={explorerStyles.pathDescription}>
<strong>Example:</strong>{' '}
<code>
<a href={examplePath}>{examplePath}</a>
<a
href={`https://api.covidtracking.com${examplePath}`}
>{`https://api.covidtracking.com${examplePath}`}</a>
</code>
</p>
</>
Expand Down
7 changes: 7 additions & 0 deletions src/pages/data/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ export default ({ data }) => {
id={data.contentfulSnippet.contentful_id}
/>
</LongContent>
<h2>API domain name</h2>
<p>
All API requests should be made to:{' '}
<strong>
<code>https://api.covidtracking.com</code>
</strong>
</p>
<ApiExplorer />
</Layout>
)
Expand Down

0 comments on commit f3b7f37

Please sign in to comment.