open port 10000
This commit is contained in:
parent
60ce95ff84
commit
332981c8b0
1 changed files with 5 additions and 5 deletions
10
server.js
10
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}`)
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue