본문 바로가기

Lecture

(86)
FORM tag form element를 통해서 HTML과 server간의 interaction을 만든다. NAME : ID : PASSWORD : action을 이용해서 localhost랑 html을 연결해준다. input type = "submit" >> rendered button : 생긴 내용을 적용시켜 링크이동해주는 버튼 >> form handler : form data를 submit하는 submit button
query DEFAULT : const express = require('express'); const app = express(); const nunjucks = require('nunjucks'); nunjucks.configure('views',{ express:app, autoescape:true, }); app.set('view engine','html'); app.listen(3000,()=>{ // 여기로 서버 실행할 꺼야 console.log('server start port : 3000'); }); 서버를 http://localhost:3000/?name=asdf&id=web7722&pw=1234 { console.log(req.query); }); 이번엔 이렇게 치고 서버를 재실행 하면 reque..
Render JS app.get('/',(req,res)=>{ //request, respond app.get('/',(a,b)=>{}) res.render('index.html',{ title : req.query.name, user_id : req.query.id, user_pw : req.query.pw, }); }); HTML Hello World! {{title}} ID : {{user_id}} Password : {{user_pw}} DEFAULT : nunjucks를 이용해서 html과 js연결해 둔 상태. 브라우저에 http://localhost:3000/?name=asdf&id=web7722&pw=1234
서버 여는 법 node "파일이름" js에 작성해논 port로 연결이 됨 브라우저에서 localhost:포트넘버 로 열면 열림 지금 같은 경우에선 localhost:3000
view engine : nunjucks nunjucks 설치 terminal에서 npm init
express 설치 방법 vscode재실행 npm init entrypoint 에서 "파일이름.js' npm install express
git - user Information 최초에 사용자 정보를 저장할때 $ git config --global user.name "name" $ git config --global user.email [email] email에 대괄호는 없어도 됨. 임의로 적은거 이렇게 입력한 정보를 git config --list 로 확인함
Template Literals '' || ""