This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', () => { |