Quantcast
Channel: Node.jsタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8898

How to construct web scraping service by Node.js Express on AWS EC2 linux instance (no.1 of 3)

$
0
0

this document is a weak memorandum for my cheap working job

connect AWS EC2 instnce

connect by SSH to Linux instance from ec2-user

  • push [Connect] buttom below

スクリーンショット 2020-05-12 0.22.29.png

use EC2 Instance Connect (browser base SSH conection)

  • select EC2 Instance Connect and push [Connect] buttom below

スクリーンショット 2020-05-12 0.23.20.png

install Node.js

install nvm (node version manager)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash

activate nvm

. ~/.nvm/nvm.sh

install recent version of Node.js

nvm install node

test for correct Node.js install and execute

node -e"console.log('Running Node.js ' + process.version)"

then display below on terminal

Running Node.js VERSION

install Express web framework for Node.js

make service directory and change this directory

mkdir dev/nodejs/express/app
cd dev/nodejs/express/app

initialise Node.js project

npm init -y

install Node.js web framework Express

npm install--save express

then create node_modules folder and setting lock file package-lock.json

install express that create web application template library for express framework

install Express-Generator and create a template

npm install-g express-generator

create web application template what name is members

express --view=ejs members 

move directory for web application template and install

cd members
npm install

test running express web application

npm start

then display terminal blow

> members@0.0.0 start /home/ec2-user/dev/nodejs/express/app/members
> node ./bin/www

access web browser to URL

http://localhost:3000
or
http://0.0.0.0:3000
or
http://computer-name:3000

then display web browser blow

スクリーンショット 2020-05-12 0.21.23.png


Viewing all articles
Browse latest Browse all 8898

Trending Articles