Created
November 6, 2017 12:50
-
-
Save AVGP/df59c415e7c2d4ab5409742786785bcf to your computer and use it in GitHub Desktop.
Hosting Data3D in Aframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script> | |
<script src="https://dist.3d.io/3dio-js/1.x.x/3dio.min.js"></script> | |
</head> | |
<body> | |
<a-scene> | |
<a-entity position="0 0 -2" io3d-data3d="url:untitled.gz.data3d.buffer"></a-entity> | |
</a-scene> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instructions: | |
// Run the following commands in the same folder that this file is in, then open http://localhost:8080 | |
// | |
// npm install express express-static-gzip | |
// node server.js | |
var express = require("express"); | |
var expressStaticGzip = require("express-static-gzip"); | |
var app = express(); | |
app.get('/untitled.gz.data3d.buffer', (req, res) => { | |
res.set('content-encoding', 'gzip') | |
res.sendFile(__dirname + '/untitled.gz.data3d.buffer') | |
}) | |
app.use("/", expressStaticGzip("./")); | |
app.listen(8080, () => { console.log('server running') }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment