Creating a WebSocket Server Project with Node.js
This article shows how to create the required WebSocket server project for Angular applications using Node.js.

This tutorial uses Visual Studio Code that can be downloaded for free.
Creating the WebSocket Server Project
-
Open a Node.js command prompt, create an empty folder called "websocket-server", navigate into and type in the following command to install Express, the minimalist web framework for node:
npm i express -
Now, install the WebSocket Server package of TX Text Control:
npm i @txtextcontrol/tx-websocket-server -
Open this folder in Visual Studio Code by typing in the following command:
code . -
In Visual Studio Code, create a new file named app.js in the project's root folder:
Copy the following code into this JavaScript file and save it:
const { WebSocketServer } = require('@txtextcontrol/tx-websocket-server'); const express = require('express'); const app = express(); const server = app.listen(8080); var wsServer = new WebSocketServer(server); -
Back in the command prompt, start the Node.js application by typing in the following command:
node app.js
Connecting the Angular Application
When connecting an Angular based document editor application with this Node.js WebSocket Server, add this endpoint to the webSocketURL parameter:
<tx-document-editor
width="1000px"
height="500px"
webSocketURL="ws://localhost:8080/TXWebSocket">
</tx-document-editor>Angular
Integrate document processing, editing, sharing, collaboration, creation, electronic signatures, and PDF generation into your Angular Web applications.
Related Posts
Creating an Angular Document Editor Application with a Node.js WebSocket Server
This tutorial shows how to create an Angular application that uses the Document Editor with a Node.js WebSocket server.
Integrate Document Editing into any HTML Client using the HTML Widget
The HTML widget can be used to integrate document editing into any HTML client including vanilla HTML, Angular, node.JS and any other client-side framework.
Creating an Angular Document Editor Application
This article shows how to integrate the HTML5-based document editor into Angular applications.
Text Control Roadmap 2019: High DPI Support, Forms, Node.js and Angular
It is time to unveil parts of our roadmap for 2019 to help users with decisions and planning including upcoming functionality in our products.
Building an ASP.NET Core Backend (Linux and Windows) for the Document Editor…
This article shows how to create a backend for the Document Editor and Viewer using ASP.NET Core. The backend can be hosted on Windows and Linux and can be used in Blazor, Angular, JavaScript, and…
