/node-websocket

Example of a websocket-based application developed in Kubernetes with Okteto

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Chat Application demo

This is an example of a websocket-based NodeJS application developed in an Okteto Cloud development environment.

  1. Install the Okteto CLI

  2. Connect your CLI to your Okteto Cloud account:

     okteto context use https://cloud.okteto.com
    

    If this is the first time you use Okteto Cloud, a free account will be automatically created for you.

  3. Launch your NodeJS development environment:

    okteto up
    

    okteto up will deploy your development environment in Okteto Cloud and drop you on a remote shell. Any command that you execute here will be executed in your remote development environment.

  4. Install the required dependencies in your remote development environment:

    okteto> npm install
    
  5. Start the application in your remote development environment:

    okteto> npm start
    
  6. Go to Okteto Cloud and click on your development environment's URL (it will something like https://chat-YOUR_GITHUB_ID.cloud.okteto.net).

  7. Start chatting!

Okteto will automatically synchronize your local changes to your remote development environment and nodemonwill automatically detect it and reload the process. Open this project in your local IDE and try adding a background color to views/index.js or a new log to server.js and reload the page to see your changes instantly.

Cleanup

Run okteto down when you are done to delete your remote development environment. You can use okteto down -v if you also want to delete the synchronization volume.