Skip to content

IW-MOON/Comfy-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 

Repository files navigation

Comfy-Server

1. 서버 아키텍처

수정됨_server_archi

2. Nginx

1) Listen HTTP 80 Port

2) Listen HTTPS 443 Port

3. Express(Node)

1) Node Modules

  • mysql
  • aws-sdk
  • winston
  • winston-daily-rotate-file
  • jsonwebtoken
  • google-auth-library

2) Routes구조

  • source/app.js

routes1

  • app.use('/', indexRouter)
  • source/routes/index.js

routes2

  • const login = require('./login/index')
  • source/routes/login/index.js

routes3

  • const controller = require('./login.controller')
  • router.post('/auth', controller.main)
  • source/routes/login/login.controller.js
  • const dao = require('./login.dao')
  • const auth_config_dev = require('/source/config/auth_config_dev.js');
exports.main = (req, res, next) => {
  const result = await dao.selectToken(payload);
}
  • source/routes/login/login.dao.js
  • const db_config_dev = require('/source/config/db_config_dev.js')
  • const conn = db_config_dev.init()
db_config_dev.connect(conn);
module.exports = {
  selectToken : function(payload){
    var sql = 'SELECT token FROM user WHERE GOOGLE_ID = ?';
    var params = [payload.sub];
    try {
      return new Promise(function(resolve, reject){
        conn.query(sql, params, function(err,rows){
          if(err) reject(err);
          resolve(rows);
        });
      });
    }
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published