diff --git a/server.js b/server.js index ec3ff3f..c1cb2c3 100644 --- a/server.js +++ b/server.js @@ -16,7 +16,7 @@ const { pipeline } = require('stream') const pump = util.promisify(pipeline) //uuid -const { +const { v1: uuidv1, v4: uuidv4, } = require('uuid'); @@ -42,13 +42,13 @@ fastify.get("/", function (request, reply) { //'post' fastify.post("/", async function (request, reply) { - + // -- "accumulate whole file in memory" const data = await request.file() const buffer = await data.toBuffer() // <<< https://github.com/fastify/fastify-multipart/#accumulate-whole-file-in-memory // ^--- this is needed.. dont understand fully, though. related to 'stream' receiving. - + const client = new Client(server); //create unique folder ==> timestamp + uuid @@ -66,11 +66,11 @@ fastify.post("/", async function (request, reply) { }); //listen -fastify.listen(process.env.PORT, function (err, address) { +fastify.listen(10000, function (err, address) { if (err) { fastify.log.error(err) process.exit(1) } console.log(`Your app is listening on ${address}`) fastify.log.info(`server listening on ${address}`) -}); \ No newline at end of file +});