diff options
author | Chocobozzz <me@florianbigard.com> | 2020-04-10 15:07:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-04-10 15:23:25 +0200 |
commit | 5e2b2e2775421cd98286d6e2f75cf38aae7a212c (patch) | |
tree | d92e32824d83cecbe5e90206738f393b47e55754 /server/tests/fixtures/peertube-plugin-test-five/main.js | |
parent | 9afa0901f11c321e071c42ba3c814a3af4843c55 (diff) | |
download | PeerTube-5e2b2e2775421cd98286d6e2f75cf38aae7a212c.tar.gz PeerTube-5e2b2e2775421cd98286d6e2f75cf38aae7a212c.tar.zst PeerTube-5e2b2e2775421cd98286d6e2f75cf38aae7a212c.zip |
Add ability for plugins to add custom routes
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-five/main.js')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test-five/main.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-five/main.js b/server/tests/fixtures/peertube-plugin-test-five/main.js new file mode 100644 index 000000000..c1435b928 --- /dev/null +++ b/server/tests/fixtures/peertube-plugin-test-five/main.js | |||
@@ -0,0 +1,21 @@ | |||
1 | async function register ({ | ||
2 | getRouter | ||
3 | }) { | ||
4 | const router = getRouter() | ||
5 | router.get('/ping', (req, res) => res.json({ message: 'pong' })) | ||
6 | |||
7 | router.post('/form/post/mirror', (req, res) => { | ||
8 | res.json(req.body) | ||
9 | }) | ||
10 | } | ||
11 | |||
12 | async function unregister () { | ||
13 | return | ||
14 | } | ||
15 | |||
16 | module.exports = { | ||
17 | register, | ||
18 | unregister | ||
19 | } | ||
20 | |||
21 | // ########################################################################### | ||