aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures/peertube-plugin-test-six/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-six/main.js')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-six/main.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-six/main.js b/server/tests/fixtures/peertube-plugin-test-six/main.js
index bb9aaffa7..858bdb2df 100644
--- a/server/tests/fixtures/peertube-plugin-test-six/main.js
+++ b/server/tests/fixtures/peertube-plugin-test-six/main.js
@@ -1,6 +1,10 @@
1const fs = require('fs')
2const path = require('path')
3
1async function register ({ 4async function register ({
2 storageManager, 5 storageManager,
3 peertubeHelpers 6 peertubeHelpers,
7 getRouter
4}) { 8}) {
5 const { logger } = peertubeHelpers 9 const { logger } = peertubeHelpers
6 10
@@ -11,6 +15,18 @@ async function register ({
11 const result = await storageManager.getData('superkey') 15 const result = await storageManager.getData('superkey')
12 logger.info('superkey stored value is %s', result.value) 16 logger.info('superkey stored value is %s', result.value)
13 } 17 }
18
19 {
20 getRouter().get('/create-file', async (req, res) => {
21 const basePath = peertubeHelpers.plugin.getDataDirectoryPath()
22
23 fs.writeFile(path.join(basePath, 'Aladdin.txt'), 'Prince Ali', function (err) {
24 if (err) return res.sendStatus(500)
25
26 res.sendStatus(200)
27 })
28 })
29 }
14} 30}
15 31
16async function unregister () { 32async function unregister () {