This is an example of a websocket-based NodeJS application developed in an Okteto Cloud development environment.
-
Install the Okteto CLI
-
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.
-
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. -
Install the required dependencies in your remote development environment:
okteto> npm install
-
Start the application in your remote development environment:
okteto> npm start
-
Go to Okteto Cloud and click on your development environment's URL (it will something like https://chat-YOUR_GITHUB_ID.cloud.okteto.net).
-
Start chatting!
Okteto will automatically synchronize your local changes to your remote development environment and nodemon
will 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.
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.