Read about Cloud Hosted Developer Environments in this blog post - Intelligent Productivity and Collaboration, from Anywhere.
This repository is for the Spot Host.
The Spot Host powers the Spot VS Code extension.
- Node.js server (packaged using pkg)
- Runs on a specified PORT with a set INSTANCE_TOKEN
- All endpoints require valid token otherwise 401 Unauthorized
- HTTP & HTTPS available
Image1: Spot host running Image2: Connecting to host in browser Image3: Connecting to host in VS Code
A few steps to get you started right away:
Download latest Spot Host
# For linux
wget https://github.com/derekbekoe/spot/releases/download/v0.2.0/spot-host
wget https://github.com/derekbekoe/spot/releases/download/v0.2.0/pty.node
Start the host
chmod +x spot-host
export PORT=8080
export INSTANCE_TOKEN=mySecretToken
./spot-host
The following environment variables can be configured:
Name | Description |
---|---|
PORT |
The port to run the host on. |
INSTANCE_TOKEN |
The token required to connect to the Spot Host. |
USE_SSL |
(optional) '1' if SSL should be used otherwise, don't use SSL. |
C_DOMAIN |
(optional) The domain that SSL is provided for. Used in /etc/letsencrypt/live/C_DOMAIN/[privkey.pem,fullchain.pem] to find the certs. |
SPOT_FILE_WATCH_IGNORE_DOT_FILES |
(optional) Set this to ignore .dotfiles for the file watcher. This hides those files from the VS Code file list. By default, no files are ignored. |
SPOT_FILE_WATCH_PATH |
(optional) The path to watch and show in the VS Code file list. |
Looking to contribute or debug yourself?
- Clone the repository
- Run
npm install
- Run
export PORT=3000
- Run
export INSTANCE_TOKEN=mySecretToken
- Run
node app.js
Fix up pty.node
In node_modules/node-pty/lib/unixTerminal.js
, search for pty.node
and modify that line:
var pty = process.pkg ? require(path.join(path.dirname(process.execPath), 'pty.node')) : require(path.join('..', 'build', 'Release', 'pty.node'));
This will allow the server to work after being packaged with pkg.
Copy pty.node
from node_modules/node-pty/build/Release/pty.node
to the same directory as the spot host (see pkg native-addons).
Build
Build package: node_modules/.bin/pkg --out-path build package.json
Run
Set the required environment variables.
Run the Spot Host: ./build/spot-host-macos
or ./build/spot-host-linux
See GitHub Releases.