mirror of https://github.com/IoTcat/docsify.git
feat: Provide code fragments feature (#748)
parent
6ac7bace21
commit
1447c8a40a
4 changed files with 37 additions and 0 deletions
@ -0,0 +1,16 @@ |
||||
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) |
Loading…
Reference in new issue