README node hello.world¶
This node sample prints out "Hello World from Node.js!" to the console.
Introduction¶
Programm is prompting "Hello World from Node.js!" to standard output.
Description¶
The samples demonstrates how to snap a simple Node.js script with the snapcraft npm plugin.
Prerequisites¶
Please read the common node docs here, first.
Debug and Run¶
- Run 'npm install' in the terminal.
- Launch the app with the debugger attached by pressing F5.
Build and Install¶
- Launch Visual Studio Code
- Click on the Remote Explorer from the menu.
- Choose Open Folder.
- Open the directory datalayer.browse.
- Build and install snap as described here.
-
Check the output using Diagnostics:
-
Login into your ctrlX
- Navigate to Diagnostics -> Logbook
- Click Settings on the right top corner
- Enable Show system messages
- Navigate to Filter -> Units and check your snap.sdk-node-hello-world.app.service
- Now you should the see the app output diagnostics.
-
Press Refresh to update.
-
If you have root permissions, you can also watch the output on any ssh console with the command:
sudo snap logs sdk-node-hello-world.app -f | more
Console Output¶
bash
Hello World from Node.js! Thu, 07 Oct 2021 11:35:08 GMT
Hello World from Node.js! Thu, 07 Oct 2021 11:35:09 GMT
Hello World from Node.js! Thu, 07 Oct 2021 11:35:10 GMT
Hello World from Node.js! Thu, 07 Oct 2021 11:35:11 GMT
Hello World from Node.js! Thu, 07 Oct 2021 11:35:12 GMT
Install the App¶
Login into ctrlX and install the App (Apps).
Gratulations - We're finished - Let's start coding¶
Support¶
Developer Community¶
Please join the Developer Community
SDK Forum¶
Please visit the SDK Forum
Issues¶
If you've found an error in these sample, please file an issue
License¶
SPDX-FileCopyrightText: Bosch Rexroth AG SPDX-License-Identifier: MIT