본문 바로가기
728x90
반응형

IT/JavaScript와 Framework99

nodemon 모듈 - 서버 자동 재기동 모듈 Node.js 는 소스 변경시 재기동해줘야 하는데, nodemon 을 사용하면 자동 재기동이 가능함. 주로 개발에서 사용하고, 운영에서는 forever 를 주로 사용함. 개발에만 집중할 수 있도록 도와주는 패키지. npm i nodemon -g ==> global 로 설치 npm i -d nodemon ==> package.json Either through cloning with git or by using npm (the recommended way): npm install -g nodemon And nodemon will be installed globally to your system path. You can also install nodemon as a development dependency:.. 2021. 6. 16.
express 프레임웍 샘플 2 - 클라이언트 요청받아 응답받기 테스트 방법 : http://localhost:3010/ ==> 끝에 '/' 를 붙인다. ========================================================== const express = require('express') const app = express(); app.get('/', function(req,res) { res.send('hello world') }) app.get('/hello', function(req,res) { res.send('hello again...') }) app.listen(3010) console.log('server is running') =====================================================.. 2021. 6. 16.
express 프레임 웍 사용예제 https://expressjs.com/ko/ 1. 웹서버 구동 (3010번 포트로 서버 구동) ====================================================== const express = require('express') const app = express(); app.listen(3010) console.log('server is running') ====================================================== 2. 실행결과 2021. 6. 16.
express 프로젝트 만들기 1. expres-first 디렉토리 생성 2. 프로젝트 파일 생성 ~/Projects/NodeJS/express-first$ npm init -y Wrote to /home/mhchae3/Projects/NodeJS/express-first/package.json: package.json 파일이 생성되는데, 패키지 의존성 관리를 한다. 3. app.js 파일 생성. 보통 진입점으로 잡음. const express = require('express') 4. app.js 파일 생성. 보통 진입점으로 잡음. 5. 레포지토리 검색 -> npmjs 사이트에서 검색 가능함 https://www.npmjs.com/ 5. express 설치 ~/Projects/NodeJS/express-first$ npm i exp.. 2021. 6. 16.
728x90
반응형