Setting (2) 썸네일형 리스트형 Nodejs + Express + Typescript 프로젝트 세팅 필요 선행 작업 $ npm i -g yarn $ npm i -g typescript *** 만약 git 이 설치되어 있지 않다면, 아래 명령어 실행 $ brew install git 프로젝트 생성 프로젝트를 시작할 폴더를 생성 후 해당 폴더 내에서 아래 명령어 실행 $ yarn init -y $ tsc --init $ git init 라이브러리 추가 Express, nodemon, typescript 설치 $ yarn add express $ yarn add -D @types/express @types/node ts-node typescript nodemon tsconfig.json 설정 tsc --init 명령으로 파일이 생성되었을 것이다. 해당 config 에 typescript 컴파일 옵션을 추가한.. Django - Json Data Response Server / CORS control How to response to GET request 장고에서 데이터를 json 형태로 내려줄때 두가지 방법을 활용할 수 있다. HttpResponse 와 JsonResponse 를 활용해보자. 1. HttpResponse 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # myproject/views.py import json from django.http import HttpResponse def responseData(request): fakeData = [ {'name': 'Daniel', 'age': 24}, {'name': 'David', 'age': 18}, {'name': 'Peter', 'age': 32} ] return HttpResponse(json.dumps(fak.. 이전 1 다음