Skip to content

Instantly share code, notes, and snippets.

@jherr jherr/Vue-on-Tessel-2.md
Last active Dec 9, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.