Skip to content

Instantly share code, notes, and snippets.

@jherr
Last active December 9, 2018 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jherr/980ef1a240223f9b859f3e70161cf120 to your computer and use it in GitHub Desktop.
Save jherr/980ef1a240223f9b859f3e70161cf120 to your computer and use it in GitHub Desktop.
Setup Vue on Tessel 2
  • Create your project with Vue CLI.
  • Add a .npmrc file with the contents:
global-style = true
  • Add a blank .tesselignore file so that nothing is left out you don't intend.
  • Add a .tesselinclude file with the contents:
/dist
  • Create an index.js file with the contents:
const express = require('express');
const app = express();

let tessel = null;
try {
  tessel = require('tessel');
} catch(e) {
}

app.use('/', express.static(__dirname + '/dist'));
app.listen(tessel ? 80 : 8080);

if (tessel) {
  tessel.network.wifi.connection(function(error, settings) {
    console.log(`Server running at http://${settings.ip}/`);
  });
} else {
  console.log("Server running at http://127.0.0.1:8080/");
}
  • Yarn or NPM add express to your project.
  • Run yarn build
  • Execute the Tessel 2 run command:
t2 run index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment