0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Node.jsプロジェクト開始方法

Last updated at Posted at 2025-04-08

JSプロジェクト開始方法

  1. Node.jsインストール

  2. プロジェクトコマンド作成

mkdir my-project  //フォルダ作成

cd my-project     //フォルダに移動
  1. npm初期化 (package.json作成)
npm init -y
  1. 必要なモジュールのインストール
npm install express

5.コーディング server.jsファイルなどを作成しコーディング

const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello World');
});

app.listen(3000, () => {
  console.log('Server is running on http://localhost:3000');
});

6. サーバー起動

node index.js
  1. ブラウザでアクセス
http://localhost:3000
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?