mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-12-05 05:29:12 +08:00
db97a1d22a
* UPDATE .eslintrc * UPDATE lint task * FIX lint errors * CLEANUP * FIX no-eq-null warning * FIX many jsdoc warnings * FIX jsdoc issues * FIX jsdoc warnings * FIX jsdoc * FIX eqeq and no-eq-null * ADD lint to travis * UPDATE test env for eslint
17 lines
323 B
JavaScript
17 lines
323 B
JavaScript
import fetch from 'fetch'
|
|
|
|
const URL = 'https://example.com'
|
|
const PORT = 8080
|
|
|
|
/// [demo]
|
|
const result = fetch(`${URL}:${PORT}`)
|
|
.then(function (response) {
|
|
return response.json()
|
|
})
|
|
.then(function (myJson) {
|
|
console.log(JSON.stringify(myJson))
|
|
})
|
|
/// [demo]
|
|
|
|
result.then(console.log).catch(console.error)
|