https://github.com/softspiders/cross-fetch-starter
https://github.com/softspiders/cross-fetch-starter
browser cross-fetch fetch isomorphic min node react-native softspiders ss starter template
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/softspiders/cross-fetch-starter
- Owner: softspiders
- License: mit
- Created: 2020-02-10T11:25:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-21T11:13:33.000Z (over 6 years ago)
- Last Synced: 2025-03-05T07:35:16.451Z (over 1 year ago)
- Topics: browser, cross-fetch, fetch, isomorphic, min, node, react-native, softspiders, ss, starter, template
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[SOFTSPIDERS](https://github.com/softspiders/softspiders)
# cross-fetch-starter
---
## Feature tags
- browser
- cross-fetch
- isomorphic
- starter
- template
---
## Authors
- [AndreyChapkin](https://github.com/AndreyChapkin)
---
## Install
```
npm i
```
---
## Run in browser
Open *index.html* with your browser. In browser console execute:
```
if (isBrowser) fetch('https://jsonplaceholder.typicode.com/posts/1')
.then(response => response.json())
.then(json => console.log(JSON.stringify(json)))
```
See the results in the console.
## Running integration tests
In first command prompt run server:
```
npm run start:server
```
In second command prompt run tests:
```
npm run test
```
In console you should see:
```
PASS ./scripts.test.js
√ Test isomorphic fetch function: http://localhost:3000/api (31ms)
```
---
### License
Licensed under the [MIT license](./LICENSE).