What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-26 14:16:12
if (req.url === "/script.js")
var http = require('http'); var url = require('url'); var fs = require('fs'); var path = require('path'); http.createServer(function(req, res) { if (req.url === '/') { fs.readFile('./index.html', function(err, data) { if (err){ ... Add solution -
Javascript 2021-10-03 20:04:04
serving html and css with node js
// HTTP Module for Creating Server and Serving Static Files Using Node.js // Static Files: HTML, CSS, JS, Images // Get Complete Source Code from Pabbly.com var http = require('http'); var fs = require('fs'); var path = require('path'); http.createServe... Add solution -
Javascript 2021-09-14 23:48:01
node js download file to folder
var http = require('http'); var fs = require('fs'); var download = function(url, dest, cb) { var file = fs.createWriteStream(dest); var request = http.get(url, function(response) { response.pipe(file); file.on('finish', function() { fil... Add solution -
Javascript 2021-09-10 16:11:01
small vedios 1 min
// Requires "request" to be installed (see https://www.npmjs.com/package/request) var request = require('request'); var fs = require('fs'); request.post({ url: 'https://api.remove.bg/v1.0/removebg', formData: { image_file: fs.createRead... Add solution