简体   繁体   English

你如何在亚马逊上部署伪造查看器? #autodesk #forge 查看器

[英]how do you deploy forge viewer on amazon? #autodesk #forge viewer

I'm new to forge.我是锻造新手。 i've already got the aws setup and have the accessKeyId and secretAccessKey.我已经设置好 aws 并拥有 accessKeyId 和 secretAccessKey。 when I run the viewer I get an "ConfigError: Missing region in config"当我运行查看器时,我得到一个“ConfigError: Missing region in config”

For some strange reason even removed the client id and client secret.出于某种奇怪的原因,甚至删除了客户端 ID 和客户端密码。 but it doesn't say anything about the client ID and client key但它没有说明客户端 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;
    }

Note that Forge Viewer itself is a JavaScript library.请注意,Forge Viewer 本身是一个 JavaScript 库。 You do not need to deploy it anywhere, just include the following tags in the <head> of your HTML markup:您不需要在任何地方部署它,只需在 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM