'Programming > web 관련' 카테고리의 다른 글
chrome 보안 무시 (0) | 2018.11.13 |
---|---|
REST API HTTP 에러코드 (0) | 2018.11.06 |
tinestamp(epoch) to utc / localtime (0) | 2018.09.07 |
li 글자 수직정렬하기 (0) | 2018.08.30 |
user agent stylesheet (0) | 2018.08.29 |
chrome 보안 무시 (0) | 2018.11.13 |
---|---|
REST API HTTP 에러코드 (0) | 2018.11.06 |
tinestamp(epoch) to utc / localtime (0) | 2018.09.07 |
li 글자 수직정렬하기 (0) | 2018.08.30 |
user agent stylesheet (0) | 2018.08.29 |
node.js 에서 다른 REST 서버로 요청하는걸 찾는중
option의 type을 지정하는거군..
[링크 : http://devnauts.tistory.com/95]
[링크 : http://shiya.io/send-http-requests-to-a-server-with-node-js/]
node.js 글로벌 모듈 목록보기 (0) | 2018.09.11 |
---|---|
node-rtsp-stream 윈도우에서 설치하기는 실패? (0) | 2018.09.11 |
cURL 그리고 REST (6) | 2018.09.09 |
node.js rtsp 스트리밍 (0) | 2018.09.07 |
RESTful (0) | 2018.09.07 |
"node.js 인 액션" 책 보다가 검색
cURL에서 -X 옵션을 주면 된다
$ curl -X GET http://127.0.0.1:3000/api/users/bakyeono $ curl -X POST http://127.0.0.1:3000/api/languages/ansi-common-lisp $ curl -X PUT http://127.0.0.1:3000/api/resources/1789 |
[링크 : https://bakyeono.net/post/2016-05-02-rest-api-client-for-cli.html]
-X/--request <command> (HTTP) Specifies a custom request method to use when communicating with the HTTP server. The specified request will be used instead of the method otherwise used (which defaults to GET). Read the HTTP 1.1 specification for details and explanations. Common additional HTTP requests include PUT and DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and more. (FTP) Specifies a custom FTP command to use instead of LIST when doing file lists with FTP. If this option is used several times, the last one will be used. |
[링크 : https://linux.die.net/man/1/curl]
node-rtsp-stream 윈도우에서 설치하기는 실패? (0) | 2018.09.11 |
---|---|
node.js HTTP 요청하기 (0) | 2018.09.10 |
node.js rtsp 스트리밍 (0) | 2018.09.07 |
RESTful (0) | 2018.09.07 |
node.js jwt -JSON Web Token (0) | 2018.09.07 |
찾아보는데.. ffmpeg을 통해서 로컬에서 변환해서 전송해주는 방식
그러면.. 타임스탬프를 받을 수 있으려나?
[링크 : https://github.com/phoboslab/jsmpeg]
node.js HTTP 요청하기 (0) | 2018.09.10 |
---|---|
cURL 그리고 REST (6) | 2018.09.09 |
RESTful (0) | 2018.09.07 |
node.js jwt -JSON Web Token (0) | 2018.09.07 |
아직 쓸일은 없지만 걍 찾아본 node.js ssl 적용 (0) | 2018.09.07 |
timestamp 값을 UTC나 로컬시간(한국이라면 KST)로 출력하는 방법을 찾는중
단순하게 date() 객체를 이용하면 될 듯
[링크 : https://stackoverflow.com/.../how-to-convert-a-timestamp-string-to-local-time-using-javascript]
[링크 : https://stackoverflow.com/questions/6525538/convert-utc-date-time-to-local-date-time/18330682]
테스트를 위해서 브라우저의 timezone을 변경해야 하는데
linux라면 export TZ 로 간단하게 할 수 있긴한데 윈도우는 이렇다할 방법을 아직 못 찾고
대신 플러그인을 발견함.
[링크 : https://gist.github.com/dustinsmith1024/dab3560abaa62cbe0754117d44c71026
[링크 : https://chrome.google.com/.../change-timezone-time-shif/nbofeaabhknfdcpoddmfckpokmncimpj]
REST API HTTP 에러코드 (0) | 2018.11.06 |
---|---|
sso openid oauth (0) | 2018.09.10 |
li 글자 수직정렬하기 (0) | 2018.08.30 |
user agent stylesheet (0) | 2018.08.29 |
div min-width (4) | 2018.08.28 |
URI나 CRUD 등의 개념이 나오는데
서버에 대해서 하나의 주소 경로로 하여 명사형으로 URI를 구성하고
GET/PUT/POST/DELETE HTTP 메소드를 이용하여
DB의 create/read(select)/update/delete를 구현한다는 것 정도로 일단 이해
[링크 : https://nesoy.github.io/articles/2017-02/REST]
[링크 : https://spoqa.github.io/2013/06/11/more-restful-interface.html]
[링크 : http://blog.remotty.com/blog/2014/01/28/lets-study-rest/]
[링크 : https://beyondj2ee.wordpress.com/2013/03/21/당신의-api가-restful-하지-않은-5가지-증거/]
cURL 그리고 REST (6) | 2018.09.09 |
---|---|
node.js rtsp 스트리밍 (0) | 2018.09.07 |
node.js jwt -JSON Web Token (0) | 2018.09.07 |
아직 쓸일은 없지만 걍 찾아본 node.js ssl 적용 (0) | 2018.09.07 |
node.js exec와 JSON.parse() (0) | 2018.09.07 |
사용자 인증에 많이들 쓰인다고..
[링크 : https://www.codementor.io/olatundegaruba/5-steps-to-authenticating-node-js-with-jwt-7ahb5dmyr]
[링크 : https://medium.freecodecamp.org/securing-node-js-restful-apis-with-json-web-tokens-9f811a92bb52]
[링크 : https://velopert.com/2448]
[링크 : https://uncle-bae.blogspot.com/2016/06/npm-npm-install-packagejson.html]
+
2018.09.18
[링크 : http://victorydntmd.tistory.com/116]
[링크 : https://www.npmjs.com/package/express-jwt]
[링크 : https://www.a-mean-blog.com/ko/blog/Node-JS-API/_/JWT-JSON-Web-Token-로-로그인-REST-API-만들기]
x token middleware
[링크 : https://medium.freecodecamp.org/securing-node-js-restful-apis-with-json-web-tokens-9f811a92bb52]
+
2018.11.06
토큰 재발급 관련
[링크 : https://swalloow.github.io/implement-jwt]
+
2019.02.08
[링크 : https://medium.com/@onejohi/securing-your-express-restful-apis-using-json-web-tokens-8c2fff0f4e7f]
node.js rtsp 스트리밍 (0) | 2018.09.07 |
---|---|
RESTful (0) | 2018.09.07 |
아직 쓸일은 없지만 걍 찾아본 node.js ssl 적용 (0) | 2018.09.07 |
node.js exec와 JSON.parse() (0) | 2018.09.07 |
node.js express template (0) | 2018.09.06 |
RESTful (0) | 2018.09.07 |
---|---|
node.js jwt -JSON Web Token (0) | 2018.09.07 |
node.js exec와 JSON.parse() (0) | 2018.09.07 |
node.js express template (0) | 2018.09.06 |
node.js exec() (0) | 2018.09.06 |
test.js
var exec = require('child_process').exec, child; child = exec("type test.txt", function(error, stdout, stderr) { console.log(stdout); var obj = JSON.parse(stdout); console.log(obj.name); if(error !== null) { console.log(error); } }); |
test.txt
{ "name": "식빵", "family": "웰시코기", "age": 1, "weight": 2.14 } |
결과.. 으으 인코딩 건드리기 싫다...
아무튼 type으로 파일 내용 돌려받고(즉, 아무 명령어나 실행하고 그 결과를 받아)
JSON 포맷일 경우 파싱해서 사용가능한걸 실증!
D:\node_test>node test.js { "name": "�Ļ�", "family": "�����ڱ�", "age": 1, "weight": 2.14 } �Ļ� |
node.js jwt -JSON Web Token (0) | 2018.09.07 |
---|---|
아직 쓸일은 없지만 걍 찾아본 node.js ssl 적용 (0) | 2018.09.07 |
node.js express template (0) | 2018.09.06 |
node.js exec() (0) | 2018.09.06 |
node.js / express/ pug(jade) 문법 (0) | 2018.09.05 |
기본 템플릿은 express-generator를 통해서 만들면 되긴 하는데
C:\> npm install -g express-generator ... + express-generator@4.16.0 added 10 packages in 2.2s C:\>express --ejs warning: option `--ejs' has been renamed to `--view=ejs' create : public\ create : public\javascripts\ create : public\images\ create : public\stylesheets\ create : public\stylesheets\style.css create : routes\ create : routes\index.js create : routes\users.js create : views\ create : views\error.ejs create : views\index.ejs create : app.js create : package.json create : bin\ create : bin\www install dependencies: > npm install run the app: > SET DEBUG=node-test:* & npm start |
[링크 : http://pyrasis.com/nodejs/nodejs-HOWTO]
[링크 : https://www.npmjs.com/package/express-generator]
-g는 global의 g
[링크 : http://someoneofsunrin.tistory.com/59]
app.js 에 ejs를 기본으로 삼아서 불편할 수도 있다.
// view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'ejs'); |
아무튼.. 기본 적인 소스 틀 만들기에는 express-generator가 무난해 보인다.
+
2018.09.11
$ express --view=pug myapp |
아직 쓸일은 없지만 걍 찾아본 node.js ssl 적용 (0) | 2018.09.07 |
---|---|
node.js exec와 JSON.parse() (0) | 2018.09.07 |
node.js exec() (0) | 2018.09.06 |
node.js / express/ pug(jade) 문법 (0) | 2018.09.05 |
npm package.json (0) | 2018.09.05 |