const story = (path: string) => `https://node-hnapi.herokuapp.com/${path}`; const user = (path: string) => `https://hacker-news.firebaseio.com/v0/${path}.json`; export default async function fetchAPI(path: string) { const url = path.startsWith('user') ? user(path) : story(path); const headers = { 'User-Agent': 'chrome' }; try { let response = await fetch(url, { headers }); let text = await response.text(); try { if (text === null) { return { error: 'Not found' }; } return JSON.parse(text); } catch (e) { console.error(`Recevied from API: ${text}`); console.error(e); return { error: e }; } } catch (error) { return { error }; } } 5b10c32'/> Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/Source/Python/WarpX_py.cpp (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2020-12-01setup.py: new release tagGravatar Axel Huebl 1-1/+1
2020-12-01Add the possibility to disable Schwinger in part of the domain (#1524)Gravatar NeilZaim 8-74/+165
* Add the possibility to disable Schwinger in part of the domain * Update checksum benchmarks * Only query ymin and ymax in 3D
2020-12-01Update README (#1540)Gravatar Remi Lehe 1-2/+0
2020-12-01Adding Particle Extrema Reduced Diagnostics (#1316)Gravatar Yinjian Zhao 6-0/+521
* Update inputs_3d * Add XZ and RZ * Add chi * add units * fix mass * Apply suggestions from code review * fix compute of gamma for photon * can compile * update * add doc Co-authored-by: Luca Fedeli <luca.fedeli.88@gmail.com>
2020-12-01Fix some warnings related to double to float conversions (#1533)Gravatar Luca Fedeli 9-36/+37
* fixed several warnings related to double to float conversions Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2020-12-01Update and fix to picmi.py (#1539)Gravatar David Grote 1-2/+5
2020-12-01Update landing page of WarpX documentation (#1538)Gravatar Remi Lehe 1-9/+2