Manol T.
Explore posts from serversWWasp-lang
•Created by Manol T. on 11/29/2023 in #🙋questions
How to store client secrets?
hey, @martinsos , here's the working code for azure:
https://github.com/AIAccelerator/BookPlanner/commit/d944956e991179857a3301e40f3819f7bcb3c059
My primary issue with the access in Azure - it was set to private and I wasn't able to uplaod there. As a second thing, my SaS token (the access token) didn't have writing rules.
It was a matter of deeper understanding how the azure storage works (although i work with it for a first time).
thanks for the help!
8 replies
WWasp-lang
•Created by Manol T. on 11/29/2023 in #🙋questions
How to store client secrets?
I am able to upload a file through curl request by passing the file directly to curl, but i didn't manage to make the react part working ..
8 replies
WWasp-lang
•Created by Manol T. on 11/29/2023 in #🙋questions
How to store client secrets?
this is my curernt implementation:
const uploadFileToBlob = async (data) => {
if (!(data.file && data.file.length > 0)) {
return;
}
const file = data.file[0]; const fileName = await fileUpload(file, 'bookgpt'); console.log(fileName); };
async function fileUpload(file, containerName) { try { let storageAccount = "bookgpt"; const sasToken = encodeURI('sas token here');
const blobService = new BlobServiceClient(
const containerClient = blobService.getContainerClient(containerName); const blobName = encodeURIComponent(file.name); const blobClient = containerClient.getBlockBlobClient(blobName);
const options = { blobHTTPHeaders: { blobContentType: file.type, 'Access-Control-Allow-Origin': '*', }, };
const fileData = await readFileDataAsBinaryString(file); console.log(fileData); const uploadBlobResponse = await blobClient.uploadData(fileData, options); console.log("Blob was uploaded successfully. requestId: ", uploadBlobResponse.requestId); const fileString =
} catch (error) { console.error("Error uploading file to Azure: ", error); throw error; // Or handle the error as needed } }
const file = data.file[0]; const fileName = await fileUpload(file, 'bookgpt'); console.log(fileName); };
async function fileUpload(file, containerName) { try { let storageAccount = "bookgpt"; const sasToken = encodeURI('sas token here');
const blobService = new BlobServiceClient(
https://${storageAccount}.blob.core.windows.net?${sasToken}
);
const containerClient = blobService.getContainerClient(containerName); const blobName = encodeURIComponent(file.name); const blobClient = containerClient.getBlockBlobClient(blobName);
const options = { blobHTTPHeaders: { blobContentType: file.type, 'Access-Control-Allow-Origin': '*', }, };
const fileData = await readFileDataAsBinaryString(file); console.log(fileData); const uploadBlobResponse = await blobClient.uploadData(fileData, options); console.log("Blob was uploaded successfully. requestId: ", uploadBlobResponse.requestId); const fileString =
https://${storageAccount}.blob.core.windows.net/${containerName}/${blobName}
;
return fileString;
} catch (error) { console.error("Error uploading file to Azure: ", error); throw error; // Or handle the error as needed } }
8 replies
WWasp-lang
•Created by Manol T. on 11/29/2023 in #🙋questions
How to store client secrets?
this part:
https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-javascript-get-started?tabs=azure-ad#create-blobclient-directly
where they upload the file, but i use SaS token (the last tab). There's discrepancy in the source code, in the part for SaS they do not have an uploading code,
The thing is, i should convert the file object into a stream either a text content / array buffer.
Unfortunately I am not aware how to acheieve this trhough react
8 replies
WWasp-lang
•Created by Manol T. on 11/29/2023 in #🙋questions
How to store client secrets?
hello, I am sorry for the late reply.
I began integrating the azure blob uploading feature.
this is a sample documentation:
https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-upload-javascript
8 replies
How to optimize the performance of an Table
@toeknee I compare this page with the other pages and it is 30-40% slower because it has more filters and columns. Would it help if you use redis caching of the queries? For me the issue does not seems to be from the queries, but anyway, I need to check 🙂
7 replies
WWasp-lang
•Created by Manol T. on 10/28/2023 in #🙋questions
Blank Page when start the app
Hello, I just solved the issue, it seems to be a mispelled class export in the react component. I took a look into the browser console section and it told me the error.
3 replies
WWasp-lang
•Created by Manol T. on 10/25/2023 in #🙋questions
Wasp cannot find wasp root after downloading MageGPT app
thank you!
10 replies
WWasp-lang
•Created by Manol T. on 10/25/2023 in #🙋questions
Wasp cannot find wasp root after downloading MageGPT app
when I was copy pasting
10 replies
WWasp-lang
•Created by Manol T. on 10/25/2023 in #🙋questions
Wasp cannot find wasp root after downloading MageGPT app
I see, it might be something ubuntu related
10 replies
WWasp-lang
•Created by Manol T. on 10/25/2023 in #🙋questions
Wasp cannot find wasp root after downloading MageGPT app
10 replies
WWasp-lang
•Created by Manol T. on 10/25/2023 in #🙋questions
Wasp cannot find wasp root after downloading MageGPT app
I've placed .wasproot file and it is working now. This file was not part of the zip which I've downloaded
10 replies
How to put Filament assets together with Vite assets?
It is kind of strange for me to have 2 commands for build and initially I thought it is the incorrect way.
Would you tell me about the filament published assets in public/ - is the intention to include it in a blade template or the idea is to put it into the vite build?
8 replies