diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-07 16:57:28 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-07 18:23:18 +0200 |
commit | 709756b8e183f67ef9bf8f7bc149af4736260350 (patch) | |
tree | dc5e52878a6f56c69a4589e058e830c57b025a05 /server/controllers/client.ts | |
parent | 18c8e945089bff49d2c617c411c8a8f4575989ad (diff) | |
download | PeerTube-709756b8e183f67ef9bf8f7bc149af4736260350.tar.gz PeerTube-709756b8e183f67ef9bf8f7bc149af4736260350.tar.zst PeerTube-709756b8e183f67ef9bf8f7bc149af4736260350.zip |
Async signature and various fixes
Diffstat (limited to 'server/controllers/client.ts')
-rw-r--r-- | server/controllers/client.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index e4d69eae7..d42e8396d 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -8,15 +8,14 @@ import { | |||
8 | CONFIG, | 8 | CONFIG, |
9 | REMOTE_SCHEME, | 9 | REMOTE_SCHEME, |
10 | STATIC_PATHS, | 10 | STATIC_PATHS, |
11 | STATIC_MAX_AGE | 11 | STATIC_MAX_AGE, |
12 | OPENGRAPH_COMMENT | ||
12 | } from '../initializers' | 13 | } from '../initializers' |
13 | import { root, readFileBufferPromise } from '../helpers' | 14 | import { root, readFileBufferPromise } from '../helpers' |
14 | import { VideoInstance } from '../models' | 15 | import { VideoInstance } from '../models' |
15 | 16 | ||
16 | const clientsRouter = express.Router() | 17 | const clientsRouter = express.Router() |
17 | 18 | ||
18 | // TODO: move to constants | ||
19 | const opengraphComment = '<!-- opengraph tags -->' | ||
20 | const distPath = join(root(), 'client', 'dist') | 19 | const distPath = join(root(), 'client', 'dist') |
21 | const embedPath = join(distPath, 'standalone', 'videos', 'embed.html') | 20 | const embedPath = join(distPath, 'standalone', 'videos', 'embed.html') |
22 | const indexPath = join(distPath, 'index.html') | 21 | const indexPath = join(distPath, 'index.html') |
@@ -85,7 +84,7 @@ function addOpenGraphTags (htmlStringPage: string, video: VideoInstance) { | |||
85 | tagsString += '<meta property="' + tagName + '" content="' + tagValue + '" />' | 84 | tagsString += '<meta property="' + tagName + '" content="' + tagValue + '" />' |
86 | }) | 85 | }) |
87 | 86 | ||
88 | return htmlStringPage.replace(opengraphComment, tagsString) | 87 | return htmlStringPage.replace(OPENGRAPH_COMMENT, tagsString) |
89 | } | 88 | } |
90 | 89 | ||
91 | function generateWatchHtmlPage (req: express.Request, res: express.Response, next: express.NextFunction) { | 90 | function generateWatchHtmlPage (req: express.Request, res: express.Response, next: express.NextFunction) { |