일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 게임
- flask
- Dinosaur
- Express
- typeORM
- class
- JavaScript
- AWS
- 자료구조
- Nest.js
- MongoDB
- cookie
- Sequelize
- nestjs
- MySQL
- 정렬
- GIT
- OCR
- Queue
- mongoose
- TypeScript
- dfs
- 공룡게임
- Bull
- Python
- nodejs
- game
- react
- jest
- Today
- Total
목록static (2)
포시코딩
개요 오늘은 기존에 WebSocket으로 구현했던 신청 알림 기능을 socket.io로 바꾸는 과정을 진행했다. 기존 WebSocket로 만든 코드 SocketManager.js const http = require('http'); const WebSocket = require('ws'); class SocketManager { constructor(app) { this.server = http.createServer(app); this.wss = new WebSocket.Server({ server: this.server }); this.load(); } static sockets = []; load = () => { this.wss.on('connection', (socket) => { SocketM..
UserStorage.js 'use strict'; class UserStorage { users = { id: ['test', 'test2', 'test3'], psword: ['1234', '1234', '1234'], }; } module.exports = UserStorage; UserStorage 라는 class가 있을 때 외부에서 users 라는 field 에 접근하기 위해 다음과 같이 사용할 수 있다. 1. 인스턴스 사용 const UserStorage = require('경로'); const userStorage = new UserStorage(); console.log(userStorage.users); 2. class 자체에서 접근하기 const UserStorage = require(..