Skip to content

Instantly share code, notes, and snippets.

View sntwandy's full-sized avatar
🎯
Focusing

Wandy Santana sntwandy

🎯
Focusing
View GitHub Profile
@sntwandy
sntwandy / .json
Created July 8, 2020 05:15
Platzi Video Data.json
[
{
"id": "94156f00-db7d-42e3-b5eb-f26e256fcae1",
"title": "CQ",
"year": 2001,
"cover": "http://dummyimage.com/130x249.png/ff4444/ffffff",
"description": "Duis consequat dui nec nisi volutpat eleifend. Donec ut dolor. Morbi vel lectus in quam fringilla rhoncus.",
"duration": 1922,
"contentRating": "PG-13",
"source": "https://cbsnews.com/eleifend/pede.png",
@sntwandy
sntwandy / .js
Created July 7, 2020 13:27
Reading a string from the server and create a file.txt with the Data
const fs = require('fs');
const server = require('http').createServer();
server.on('request', (req, res) => {
if (req.method === 'POST' && req.url == '/') {
req.on('data', chunk => {
const data = chunk.toString();
const file = fs.createWriteStream(__dirname + '/output.txt');
file.write(data)
req.on('end', () => {