What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-12 13:28:02
read html file node js
const http = require("http"); //use fs module at first to read file const fs = require("fs"); const hostname = "127.0.0.1"; const port = 3000; // simple code to read file using fs module const files = fs.readFileSync("... Add solution -
Javascript 2021-10-05 20:34:05
how to DELETE "/api/notes" with an id
app.delete("/api/notes/:id", (req, res) => { let chosenNoteToDelete = req.params.id; fs.readFile(__dirname + "/db/db.json", (err, data) => { if (err) { console.log(err); res.sendStatus(500)... Add solution -
Javascript 2021-10-05 14:49:03
render html in node js
let http = require('http'); let fs = require('fs'); let handleRequest = (request, response) => { response.writeHead(200, { 'Content-Type': 'text/html' &nbs... 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