initial code commit

This commit is contained in:
Darren Swan 2019-02-01 22:35:06 -06:00
parent 923711ac6a
commit 0d98e01bc3
5 changed files with 59 additions and 2 deletions

2
.gitignore vendored
View File

@ -271,3 +271,5 @@ FakesAssemblies/
**/*.Server/ModelManifest.xml **/*.Server/ModelManifest.xml
_Pvt_Extensions _Pvt_Extensions
package-lock.json
package-lock.json

20
index.html Normal file
View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Open MCT Tutorials</title>
<script src="node_modules/openmct/dist/openmct.js"></script>
</head>
<body>
<script>
openmct.setAssetPath('node_modules/openmct/dist');
openmct.install(openmct.plugins.LocalStorage());
openmct.install(openmct.plugins.MyItems());
openmct.install(openmct.plugins.UTCTimeSystem());
openmct.time.clock('local', {start: -15 * 60 * 1000, end: 0});
openmct.time.timeSystem('utc');
openmct.install(openmct.plugins.Espresso());
openmct.start();
</script>
</body>
</html>

View File

@ -2,6 +2,15 @@
"name": "subo-openmct", "name": "subo-openmct",
"version": "0.0.1", "version": "0.0.1",
"description": "Suborbital's implementation of Open MCT", "description": "Suborbital's implementation of Open MCT",
"main": "server/server.js",
"scripts": {
"start": "node server/server.js"
},
"repository": {
"type": "git",
"url": "git+https://git.turnsys.com/Suborbital-Systems/OpenMCT.git"
},
"dependencies": { "dependencies": {
"express": "^4.16.4", "express": "^4.16.4",
"express-ws": "^4.0.0", "express-ws": "^4.0.0",

15
server/server.js Normal file
View File

@ -0,0 +1,15 @@
var StaticServer = require('./static-server');
var expressWs = require('express-ws');
var app = require('express')();
expressWs(app);
var staticServer = new StaticServer();
app.use('/', staticServer);
var port = process.env.PORT || 8080
app.listen(port, function () {
console.log('Open MCT hosted at http://localhost:' + port);
});

11
server/static-server.js Normal file
View File

@ -0,0 +1,11 @@
var express = require('express');
function StaticServer() {
var router = express.Router();
router.use('/', express.static(__dirname + '/..'));
return router
}
module.exports = StaticServer;