// NodeJS기초-11.Express 라우팅 분리하기 // ** 다음과 같이 router.js 파일을 만듭니다 const express = require('express'); var router = express.Router(); router.get('/', function (req, res) { res.send('Express Server!'); }); module.exports = router; // ** index.js 파일에서 router.js를 사용하도록 코드를 추가합니다. const express = req…
// NodeJS기초-10.Express 서버 만들기2-미들웨어 const express = require('express'); const app = express(); var router = express.Router(); // express.Router()를 사용하면 라우터 레벨의 미들웨어를 사용할 수 있습니다. app.listen(3000); // 한개의 요청을 여러개의 미들웨어가 처리할 수 있습니다. // 요청 경로(path)가 포함되지 않은 요청은 항상 실행됩니다. // function에서 next 인자를 처리하면 하위…
const express = require('express') const app = express() app.get('/', function (req, res) { res.send('Hello World') }) app.listen(3000)
NodeJS 기초 - 01.Nodejs 뭐가 좋죠? (장점 3가지) NodeJS 기초 - 02.초간단 NodeJS 설치하기 NodeJS 기초 - 03.Nodejs 실행하는 방법 3가지 NodeJS 기초 - 04.Module과 require 사용법(중요) NodeJS 기초 - 05.Nodejs 버전 쉽게 바꾸는법(NVM) NodeJS 기초 - 06.Nodejs+MySQL 연동하기 NodeJS 기초 - 07.NodeJS 서버테스트를 위한 Postman 설치 및 테스트 NodeJS 기초 - 08.Http 서버만들기-1 N…
const express = require('express') const mysql = require('mysql') const path = require('path') const static = require('serve-static') const dbconfig = require('./config/dbconfig.json') // Database connection pool const pool = mysql.createPool({ connectionLimit: 10, host: dbconfig.host, …
Lenovo Micro Desktop Computer PC, Up to 16 GB RAM 1TB SSD, Windows 11/10 WiFi Seller assumes all responsibility for this listing. eBay item number:396131452006 Last updated on Feb 03, 2025 09:38:49 PSTView all revisionsView all revisions Item specifics Condition Used Seller Notes “1-Year Warranty …
1. 백엔드 세팅: 데이타베이스 세팅, 웹소켓 세팅 2. 프론트엔드 세팅: 웹소켓 세팅 3. 백엔드 프론트 엔드 연결테스트 4. 유저 로그인 5. 메시지 주고받기 >> npm i express, mongoose, cors dotenv http >> npm install nodemon >> nodemon app.js
Installation Either through cloning with git or by using npm (the recommended way): npm install -g nodemon ============================== const express = require('express') const app = express() app.listen(3000, () => { console.log('Server is running on port 3000') }) app.get('/', (r…
[■KodeJUN] [6] Node.js npm express ** app.js function sayHello(name) { // ...existing code... console.log('Hello ' + name); // ...existing code... } sayHello('John'); // ...existing code...
■ NodeJS.org [윈도우 환경] https://nodejs.org/en 1. NodeJS.org에 접속 한 후 LTS 버전을 다운받아 설치 2. VSCode 설치 https://code.visualstudio.com/download 다운로드 한 후 로그인 코파일럿 로그인 3. VSCode 에서 터미널 열어서 node 잘 설치되어있는지 확인 C:> node * Windows PowerShell 이 아닌 Command Prompt 에서 실행해야 함 ** 질문 PowerShell says "execution…