https://github.com/apprentice3d/forge.learning.viewmodels.go
https://github.com/apprentice3d/forge.learning.viewmodels.go
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/apprentice3d/forge.learning.viewmodels.go
- Owner: apprentice3d
- License: mit
- Created: 2019-03-04T20:16:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T20:27:01.000Z (almost 7 years ago)
- Last Synced: 2024-06-20T17:34:25.499Z (over 1 year ago)
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# forge.tutorial.viewmodels.go

[](http://opensource.org/licenses/MIT)
[](http://developer.autodesk.com/)
[](http://developer.autodesk.com/)
[](http://developer.autodesk.com/)
[](http://developer.autodesk.com/)
[](http://developer.autodesk.com/)
# Description
This sample is part of the [Learn Forge](http://learnforge.autodesk.io) tutorials.
# Setup
For using this sample, you need an Autodesk developer credentials. Visit the [Forge Developer Portal](https://developer.autodesk.com), sign up for an account, then [create an app](https://developer.autodesk.com/myapps/create) 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)***
```bash
export FORGE_CLIENT_ID=<>
export FORGE_CLIENT_SECRET=<>
```
***Windows (Command Prompt)***
```bash
set FORGE_CLIENT_ID=<>
set FORGE_CLIENT_SECRET=<>
```
## Usage
There are 2 ways to run this sample:
1. Download the go_sample.zip archive appropriate to your OS from
[releases](https://github.com/Autodesk-Forge/learn.forge.viewmodels/releases).
Unzip it and start the ***sample*** executable from unzipped folder.
2. Install [Go Programming Language](https://golang.org/).
Make sure you [$GOPATH](https://github.com/golang/go/wiki/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:
```bash
// MacOS & Linux
export GOPATH=$HOME/go
```
In case of Windows, we recommend setting up the `GOPATH` into a simple location like `C:\GOPROJECTS`:
```cmd
// 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](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](http://opensource.org/licenses/MIT).
Please see the [LICENSE](LICENSE) file for full details.
## Written by
Denis Grigor [@apprentice3d](https://twitter.com/apprentice3d),
[Forge Partner Development](http://forge.autodesk.com)