mirror of
https://github.com/standardnotes/server
synced 2026-07-14 00:01:54 -04:00
19 lines
694 B
TypeScript
19 lines
694 B
TypeScript
import { Request, Response } from 'express'
|
|
import { inject } from 'inversify'
|
|
import { BaseHttpController, controller, httpPost } from 'inversify-express-utils'
|
|
|
|
import TYPES from '../../Bootstrap/Types'
|
|
import { HttpServiceInterface } from '../../Service/Http/HttpServiceInterface'
|
|
|
|
@controller('/v1/files')
|
|
export class FilesController extends BaseHttpController {
|
|
constructor(@inject(TYPES.HTTPService) private httpService: HttpServiceInterface) {
|
|
super()
|
|
}
|
|
|
|
@httpPost('/valet-tokens', TYPES.AuthMiddleware)
|
|
async createToken(request: Request, response: Response): Promise<void> {
|
|
await this.httpService.callAuthServer(request, response, 'valet-tokens', request.body)
|
|
}
|
|
}
|