Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Use Node.js for Your Website and Application

DZone 's Guide to

How to Use Node.js for Your Website and Application

In this post, we will install and configur Ubuntu 16.04 and Alibaba Cloud Elastic Compute Service (ECS) using Node.js.

· Web Dev Zone ·
Free Resource

Node.js is built on Chrome's V8 JavaScript engine and one of the popular open-source JavaScript runtime environments, which can be used to create a website, upload files, and create a TCP App on ECS. In this article, you will get some useful information on these.

How to Build a TCP Application With Node.js on ECS

Before you start the process, you will need a machine running a Linux/Unix distribution such as Ubuntu or macOS, a code editor/IDE with Node.js installed on it, and a basic working knowledge of Node.js.

To begin, create a directory where you would like to store your application. For this tutorial, we will create our application in ~/nodejs-tcp-app.

In this tutorial, we will be doing most of our work with the terminal and also, use nano editor in the terminal ensuring the process remains the same for all the platforms.

To start, open your terminal:

mkdir ~/nodejs-tcp-app

How to Create a Blogging Website With Ghost on Ubuntu 16.04

Ghost is a free and open source blogging platform, designed to simplify the process of online publishing for individual bloggers as well as online publications. It is written in JavaScript and uses Node.js as its runtime environment. Ghost uses Markdown syntax in the editor, so you can see how your blog will look like on a live site while you are writing the blog. Ghost is perfect platform for bloggers as it is very clean and lightweight.

In this guide, we will install and configure Ghost on your Ubuntu 16.04 Alibaba Cloud Elastic Compute Service (ECS) using Node.js.

How to Upload Files to Alibaba Cloud Object Storage with Node.js

To begin with, the Alibaba Cloud OSS supports RESTful API operations and SDKs for most languages. In this tutorial, we are going to use the open-source OSS JavaScript SDK for Node.js. We need to first install the ali-oss like so:

npm install ali-oss

Noteworthy, there are two modes that you can choose from; synchronous and asynchronous modes.

To use in synchronous mode, you may additionally use it in conjunction with co. Install co like so:

npm install co

The asynchronous mode supports callback.

Related Documentation

There are some documentation may be useful to you.

[Vulnerability notice] CVE-2017-5941: Remote code execution vulnerability in Node.Js deserialization]

Node.js is a Javascript runtime. It encapsulates the Google V8 engine. The Google V8 engine quickly runs Javascript with high performance. Node.js optimizes certain special cases and provides substitute APIs, which enables the Google V8 engine to run more effectively in a non-browser environment.

Node.js Logs

By default, Node.js logs are printed to the console, which makes the data collection and troubleshooting inconvenient. By using Log4js, logs can be printed to files and log format can be customized, which is convenient for data collection and coordination.

Topics:
web dev ,node.js tutorial ,node.js tutorial for beginners ,ghost blogging platform ,ubuntu

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}