๐Ÿ’ก websocket-chat

A basic example app using nlon over Websocket, powered by Express and Webpack.

Usage

Checkout the repo and install dependencies by running the following in the exampleโ€™s directory:

pnpm install

Once thatโ€™s done, you can start the application:

pnpm start

This will build the frontend and launch the server. If youโ€™d like to work on the source, use the following:

pnpm run start:dev

This will watch the code for changes, rebuilding the frontend and restart the server as needed.

With your server running, open http://localhost:3000/ to see the app running.

nlon in the browser

While nlon is not bound to any environment/runtime, the reference implementation uses a few Node modules. To run this code in the browser, you need to provide polyfills for those modules, see the webpack config for a list of modules and their polyfills.

The WebSocket adapter is isomorphic, so it can be used safely both from Node and in the browser.

License

This package is under the MIT License.

results matching ""

    No results matching ""