-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/github-login
- Loading branch information
Showing
25 changed files
with
843 additions
and
129 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules β¦
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This is a comment. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence, | ||
# @global-owner1 and @global-owner2 will be requested for | ||
# review when someone opens a pull request. | ||
* @boostcamp-2020/project12-c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Linked Issue | ||
close # | ||
|
||
## 곡μ ν μ¬ν | ||
- | ||
|
||
## λ Όμν μ¬ν | ||
- μμ΅λλ€. β |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { config as dotenv } from 'dotenv' | ||
import express from 'express' | ||
import { createServer } from 'http' | ||
import createChatServer from 'socket.io' | ||
dotenv() | ||
|
||
const server = createServer(express()) | ||
const io = createChatServer(server, { | ||
cors: { origin: process.env.FRONTEND_HOST, credentials: true }, | ||
}) | ||
|
||
const namespace = io.of('chat') | ||
namespace.use((socket, next) => { | ||
// TODO jwt κ²μ¦ λ‘μ§ νμ | ||
next() | ||
}) | ||
|
||
namespace.on('connection', socket => { | ||
socket.on('new message', data => { | ||
// TODO νΉμ μ±λλ‘ μ μ‘νλλ‘ λ³κ²½, dbμ μ μ₯ νμ (νμ¬λ μμ μ μΈ μ 체 μ μ‘) | ||
socket.broadcast.emit('new message', { | ||
message: data, | ||
}) | ||
}) | ||
}) | ||
|
||
server.listen(process.env.CHAT_PORT, () => { | ||
console.log('chat server created 4000') | ||
}) | ||
|
||
export default server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { asyncWrapper } from '../../util' | ||
import service from '../../service/channel' | ||
|
||
const createChannel = asyncWrapper(async (req, res) => { | ||
const { code, success, data } = await service.createChannel({ | ||
...req.body, | ||
creator: req.user, | ||
}) | ||
return res.status(code).json({ success, data }) | ||
}) | ||
|
||
module.exports = { createChannel } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import express from 'express' | ||
import controller from './channel' | ||
|
||
const router = express.Router() | ||
|
||
router.post('/', controller.createChannel) | ||
|
||
module.exports = router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.