- 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 -gsudo pm2 start path/to/process.jssudo pm2 start path/to/process.js -- --port 8080sudo pm2 start npm --name "your-app-alias" -- startsudo pm2 startupsudo pm2 savesudo shutdown -r nowsudo apt-get install gitsudo mkdir reposudo 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/usergit clone https://github.com/emscripten-core/emsdk.gitcd emsdkgit checkout main./emsdk install latest./emsdk activate latestsource ./emsdk_env.shWhen 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)); |