]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/clients.ts
Type functions
[github/Chocobozzz/PeerTube.git] / server / controllers / api / clients.ts
index 902f62995d5bbcf688563c73ce09c36b782ff521..8c460096bef12ec15c7c9a1d0e8ed5dd49be3825 100644 (file)
@@ -1,15 +1,15 @@
-import express = require('express')
+import * as express from 'express'
 
-import { CONFIG } from '../../initializers';
+import { CONFIG } from '../../initializers'
 import { logger } from '../../helpers'
-const db = require('../../initializers/database')
+import { database as db } from '../../initializers/database'
 
 const clientsRouter = express.Router()
 
 clientsRouter.get('/local', getLocalClient)
 
 // Get the client credentials for the PeerTube front end
-function getLocalClient (req, res, next) {
+function getLocalClient (req: express.Request, res: express.Response, next: express.NextFunction) {
   const serverHostname = CONFIG.WEBSERVER.HOSTNAME
   const serverPort = CONFIG.WEBSERVER.PORT
   let headerHostShouldBe = serverHostname