[英]how do you deploy forge viewer on amazon? #autodesk #forge viewer
我是鍛造新手。 我已經設置好 aws 並擁有 accessKeyId 和 secretAccessKey。 當我運行查看器時,我得到一個“ConfigError: Missing region in config”
出於某種奇怪的原因,甚至刪除了客戶端 ID 和客戶端密碼。 但它沒有說明客戶端 ID 和客戶端密鑰
const awsParamStore = require( 'aws-param-store' );
awsParamStore.getParametersByPath(" https://s3aecshare.s3.af-south-1.amazonaws.com/RVT_Test/rac_basic_sample_project.rvt");
const awsFlag = process.env.FORGE_AWS_FLAG;
//const paramStore = {"region": process.env.AWS_REGION}
const paramStore = {"region": "af-south-1"}
const clientId = process.env.FORGE_CLIENT_ID;
//const clientId ="-----------------------------";
//const clientSecret = process.env.FORGE_CLIENT_SECRET;
const clientSecret = "---------------------------";
// Autodesk Forge AWS configuration for SSM service
module.exports = {
// Required scopes for your application on server-side
scopeInternal: ['bucket:create', 'bucket:read', 'data:read', 'data:create', 'data:write'],
// Required scope of the token sent to the client
scopePublic: ['viewables:read'],
getParamStore: function() {
// If not running on AWS, paramStore requires access and secret AWS Keys
if (awsFlag){
return paramStore;
}else{
paramStore.credentials =
{
"accessKeyId" : "-------------------------------------",
"secretAccessKey" :"--------------------------------------"
};
}
return paramStore;
},
forgeAWSClientId: async function() {
let parameter = await awsParamStore.getParameter( clientId , this.getParamStore());
return parameter.Value;
},
forgeAWSClientSecret: async function() {
let parameter = await awsParamStore.getParameter( clientSecret ,this.getParamStore());
return parameter.Value;
}
請注意,Forge Viewer 本身是一個 JavaScript 庫。 您不需要在任何地方部署它,只需在 HTML 標記的<head>
中包含以下標記:
<link rel="stylesheet" href="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/style.min.css" type="text/css">
<script src="https://developer.api.autodesk.com/modelderivative/v2/viewers/7.*/viewer3D.min.js"></script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.