20191127 - React Native / Node.js

yjj·2019년 11월 27일
0

React Native

  • 오늘 밋업 간다!

  • Code Push
    - Code Push 라는 기능을 처음 알았다.. 지난날의 배포 과정이 스쳐가는구나..
    - 왜 몰랐을까?
    - 그런 방법이 가능한 줄 몰라서? → 어플리케이션 개발에 대한 지식 부족
    - 리액트 네이티브 개발 관련 문서들을 심도있게 읽지 않아서? 필요한 부분이 생기면 그 내용만 구글링함
    - expo를 사용하지 않아서(crypto 모듈 사용 이슈때문에) → expo를 사용했었다면 OTA라는 것을 조금 더 빨리 보지 않았을까?
    - 버그 → 수ㅌ정 → 새로 빌드 → 스토어에 새로 배포..
    image.png

    - 읽어본 글
    
        [Expo OTA](https://medium.com/@sw.lee/expo-ota-27a98d3f26b8)
    
    - 아무튼 이제라도 알게 되어서 다행이다

Node.js

  • 노드 학습 중

  • 기존 Java + Spring + Mysql 서버 → Node + Express + MongoDB로 전환하려고 한당

  • Nodeschool → 넘넘 재밌는 것 잔뜩

    NodeSchool

  • Nodeschool workshop 중에서 learnyounode를 해봤음 → 넘 재밌

  • expressworks 하는 중
    - __dirname은 이 파일의 절대 경로고 path.join은 크로스 플랫폼 경로를 만드는 데 사용합니다.(윈도우와 Linux/Mac)
    - pug engine 을 사용해서 template render 해봄

    [Express와 함께 템플리트 엔진 사용](https://expressjs.com/ko/guide/using-template-engines.html)
    
    - 마지막 챌린지 코드 → **에러 처리**는 이런 식으로 하는군
    ```javascript
        const path = require('path')
        const express = require('express')
        const app = express()
        const fs = require('fs')
        
        const PORT = process.argv[2] || 3000;
        
        app.get('/books', function(req, res){
            fs.readFile(process.argv[3], function(err, data){
                if (err) return res.sendStatus(500)
                try {
                    books = JSON.parse(data)
                } catch (e) {
                    res.sendStatus(500)
                }
                res.json(books);
            })
        })
        
        app.listen(PORT)
    ```
    
    - expressworks 다 했어유

    image.png

  • next() 대체 뭘까?

    • 대박 신기하다
    • 순서가 중요함
          var express = require('express');
          var app = express();
          
          var myLogger = function (req, res, next) {
            console.log('LOGGED');
            next();
          };
          
          app.use(myLogger);
          
          app.get('/', function (req, res) {
            res.send('Hello World!');
          });
          
          app.listen(3000);
      			```

Bookmarks

ReactNativeWithMVP.pdf

216 Most Popular Web Safe PNG Colors

profile
개발 말고도 하고싶은게 너무너무 많은 개발자입니다

0개의 댓글