- Learning Node.js Development
- Andrew Mead
- 327字
- 2021-06-30 18:56:44
Creating the Node application
The first step will be to create a folder. Every project we create will go live inside of its own folder. I'll open up the Finder on macOS and navigate to my desktop. What I'd like you to do is open up the desktop on your OS, whether you're on Linux, Windows, or macOS, and create a brand new folder called hello-world.
Now I'll use command + O (Ctrl + O for Windows users) to open up, and I'll navigate to the desktop and double-click my hello-world folder, as shown here:

On the left I have my files, which are none. So, let's create a new one. I'll make a new file in the root of the project, and we'll call this one app.js, as shown here:

This will be the only file we have inside our Node application, and in this file we can write some code that will get executed when we start the app.
In the future, we'll be doing crazy stuff like initializing databases and starting web servers, but for now we'll simply use console.log, which means we're accessing the log property on the console object. It's a function, so we can call it with parentheses, and we'll pass in one argument as string, Hello world!. I'll toss a semicolon on the end and save the file, as shown in the following code:
console.log('Hello world!');
This will be the first app we run.
- 數據通信網絡實踐:基礎知識與交換機技術
- 物聯網識別技術
- 工業控制網絡安全技術與實踐
- Hands-On Industrial Internet of Things
- INSTANT PhpStorm Starter
- Force.com Development Blueprints
- Yii Application Development Cookbook(Second Edition)
- 網絡AI+:2030后的未來網絡
- 紅藍攻防:構建實戰化網絡安全防御體系
- 物聯網工程導論(第3版)
- 物聯網與智慧農業
- Cisco無線局域網配置基礎
- 從物聯到萬聯:Node.js與樹莓派萬維物聯網構建實戰
- 區塊鏈技術與應用:打造分布式商業新生態
- 黑客心理學:社會工程學原理