-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontroller.ts
More file actions
41 lines (33 loc) · 861 Bytes
/
controller.ts
File metadata and controls
41 lines (33 loc) · 861 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
// import { JsonController, Post, Param, Get, Body, Authorized } from 'routing-controllers'
// import User from './entity';
// import { io } from '../index'
// Template to setup signup controllers
// @JsonController()
// export default class UserController {
// @Post('/users')
// async signup(
// @Body() data: User
// ) {
// const {password, ...rest} = data
// const entity = User.create(rest)
// await entity.setPassword(password)
// const user = await entity.save()
// io.emit('action', {
// type: 'ADD_USER',
// payload: entity
// })
// return user
// }
// @Authorized()
// @Get('/users/:id([0-9]+)')
// getUser(
// @Param('id') id: number
// ) {
// return User.findOneById(id)
// }
// @Authorized()
// @Get('/users')
// allUsers() {
// return User.find()
// }
// }