Azureをデータストレージとして使用して、Node and Expressでファイル共有アプリケーションを作成しようとしています。Node.jsプロジェクトのAzureサブフォルダを表示
私のコンテナのサブフォルダを表示するのに苦労しています。
私のコードは次のようになります '$$$ $$$'
私は隠すつもりで、このようなサブフォルダを作成 - ファイル:
app.post('/folderhandler', function (req, res) { var containerName = req.query.id; var folderName = req.body.folderName; var folder = folderName + '/$$$.$$$'; blobSvc.createBlockBlobFromText( containerName, folder, 'Hello, World!', function (error, result, response) { if (error) { console.log("Couldn't upload string"); console.error(error); } else { console.log('String uploaded successfully'); } }); res.redirect('/container/' + containerName); });
そして、私は新しい 'サブフォルダ'をdisplayBlobs関数の 'container'変数として使用しようとしました。しかし、これは動作しません:
app.get('/container/:containername/:subcontainer', function (req, res) { var containerName = req.params.containername; var subContainer = req.params.subcontainer; blobSvc.listContainersSegmented(null, function (err, containers) { blobSvc.listBlobsSegmented(subContainer, null, function (error, blobs) { res.render('manager.ejs', { error: error, title: 'Manager ' + containerName, pageID: 'containers', containername: subContainer, listContainers: containers.entries, listBlobs: blobs.entries, breadcrumbs: [{ href: '/manager', text: 'Manager' }, { href: '/container/' + containerName, text: containerName }, { text: subContainer, active: true }] }); }); }); });
を私はすべてを試みたと思うので、提案を開いイム:)事前に
- 感謝を!
質問を編集し、 'containerName'と' subContainer'の値を追加できますか?また、あなたが見ているもの(実際の行動)とあなたが見たいものを教えてください。 –