- Run
npm i vue-chartjs
- Run
npm i chart.js hchs-vue-charts
- Create a file called chart.js and save it in the /plugins directory
- Give chart.js the following contents
import Vue from 'vue'
import { Line } from 'vue-chartjs'
sudo npm install pm2 -g
sudo pm2 start path/to/process.js
sudo pm2 start path/to/process.js -- --port 8080
sudo pm2 start npm --name "your-app-alias" -- start
sudo pm2 startup
sudo pm2 save
sudo shutdown -r now
sudo apt-get install git
sudo mkdir repo
sudo git init --bare
--bare means that our folder will have no source files, just the version control.A number of new folders will be created, cd into the hooks directory
Download and Install Emscripten
/home/user
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git checkout main
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
When compiling client files to webassembly, usually you'll end up with both .js and .wasm files.
By default, most webservers don't know about the wasm MIME type.
You'll likely see the following error:
wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
Here is how to add the wasm MIME type (on linux systems, apache + nginx):
Open /etc/mime.types You'll see two columns, media type on the left, file type on the right Add the line application/wasm wasm
var socket = new WebSocket("ws://localhost:3000"); | |
socket.binaryType = "arraybuffer"; | |
socket.onopen = function(){ | |
var arrayBufferMessage = stringToArrayBuffer("Test message from client"); | |
socket.send(arrayBufferMessage); | |
}; | |
socket.onmessage = function(e){ | |
console.log(arrayBufferToString(e.data)); |