> For the complete documentation index, see [llms.txt](https://ivankhrenkov.gitbook.io/bware_labs_russian/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ivankhrenkov.gitbook.io/bware_labs_russian/the-basics/ispolzovanie-konechnoi-tochki-bware-labs-v-kode.md).

# Использование конечной точки Bware Labs в коде

В списке ниже вы можете найти простой фрагмент кода, демонстрирующий, как использовать конечную точку, созданную Bware Labs, в вашем коде javascript.

```
init: function() {
        ws_provider = new Web3(new Web3.providers.WebsocketProvider ('wss://' 
        + 'eth-api.bwarelabs.com/ws/69231efa-e959-4fb0-ad08-9141cda9ea4d'));
        ws_provider.eth.net.getNetworkType().then((networkID) => {
            switch (networkID) {
                case "main":
                    this.chainID = ChainId.MAINNET;
                    this.network = 'homestead';
                    break;
                case "rinkeby":
                    this.chainID = ChainId.RINKEBY;
                    this.network = 'rinkeby';
                    break;
                default:
                    this.chainID = ChainId.MAINNET;
                    this.network = 'homestead';
            }
            logger.info(`Listening on the ${networkID} network...`);
        });
        oracle_provider = new ethers.providers.WebSocketProvider('wss://'
         + 'eth-api.bwarelabs.com/ws/69231efa-e959-4fb0-ad08-9141cda9ea4d', this.network);
    },

```
