forge.learning.viewmodels.go

command module
v0.0.0-...-50eb1c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2019 License: MIT Imports: 3 Imported by: 0

README

forge.tutorial.viewmodels.go

Platforms License

oAuth2 Data-Management OSS Model-Derivative Viewer

Description

This sample is part of the Learn Forge tutorials.

Setup

For using this sample, you need an Autodesk developer credentials. Visit the Forge Developer Portal, sign up for an account, then create an app that uses Data Management and Model Derivative APIs. For this new app, use http://localhost:3000/api/forge/callback/oauth as Callback URL, although is not used on 2-legged flow. Finally take note of the Client ID and Client Secret.

Run Locally

Before running the sample, you should set the client ID & secret environment variables:

Mac OSX/Linux (Terminal)

export FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
export FORGE_CLIENT_SECRET=<<YOUR CLIENT SECRET>>

Windows (Command Prompt)

set FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
set FORGE_CLIENT_SECRET=<<YOUR CLIENT SECRET>>

Usage

There are 2 ways to run this sample:

  1. Download the go_sample.zip archive appropriate to your OS from releases.
    Unzip it and start the sample executable from unzipped folder.

  2. Install Go Programming Language.

Make sure you $GOPATH environment variable is set, this is required for first time usage. You can use a /go/ folder under your user folder in case OSX and Linux OS:

// MacOS & Linux
export GOPATH=$HOME/go

In case of Windows, we recommend setting up the GOPATH into a simple location like C:\GOPROJECTS:

// Windows
set GOPATH=C:\GOPROJECTS

After the Go language is set up, run:

```bash
go get github.com/apprentice3d/forge.learning.viewmodels.go
```

and navigate to `$GOPATH/src/github.com/apprentice3d/forge.learning.viewmodels.go` and run

```bash
go run main.go 
```

Once your app is started, open the browser: http://localhost:3000 On the webpage, the New Bucket blue button allow create new buckets (as of now, minimum input validation is implemented). For any bucket, right-click to upload a file (objects). For demonstration, objects are not automatically translated, but right-click on a object and select Translate.

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

Written by

Denis Grigor @apprentice3d,
Forge Partner Development

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL