What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-23 06:30:57
node fetch response body
const fetch = require('node-fetch'); //npm install node-fetch fetch('https://httpbin.org/post', { method: 'POST', body: 'a=1' }) .then(res => res.json()) .then(json => { // Do something... }) .catch(err => console.log(err)); Add solution -
Javascript 2021-11-12 20:01:23
service worker.js
/* Copyright 2016 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.or... Add solution -
Javascript 2021-10-22 22:59:10
sentry ignore errors
// List of errors you want to ignore Sentry.init({ dsn: "sentry_dsn", ignoreErrors: [ 'TypeError: Failed to fetch', 'TypeError: NetworkError when attempting to fetch resource.', 'TypeError: Cancelled', 'TypeError: cancelado'... Add solution -
Javascript 2021-10-05 05:16:04
fetch data from external url nodejs
const fetch = require('node-fetch'); app.get('/', function (req, res) { var url = 'https://api.darksky.net/forecast/<API KEY>/37.8267,-122.4233'; fetch(url) .then(res => res.json()) .then(data => { res.send({ ... Add solution -
Javascript 2021-09-27 12:55:06
service worker js example
/* Copyright 2016 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.or... Add solution
Best helpers
Ranking is empty