From 86b16882171de30c77f9de93fa97f90ba51b0a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 16 Aug 2021 19:43:58 +0200 Subject: [PATCH] redirect root to status.im site MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- index.js | 2 +- src/app.js | 4 ++++ test/app.js | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a66725f..1b31cdd 100644 --- a/index.js +++ b/index.js @@ -1 +1 @@ -require('./src/app.js') +require('./src/index.js') diff --git a/src/app.js b/src/app.js index f5caa1c..4127847 100644 --- a/src/app.js +++ b/src/app.js @@ -21,6 +21,10 @@ const App = ({ghc, schema}) => { .use(router.middleware()) .use(BodyParser({onerror:console.error})) + router.get('/', async (ctx) => { + ctx.redirect('https://status.im/') + }) + router.get('/health', async (ctx) => { ctx.body = 'OK' }) diff --git a/test/app.js b/test/app.js index ba744cc..ef3e287 100644 --- a/test/app.js +++ b/test/app.js @@ -19,6 +19,14 @@ describe('App', () => { app = App({ghc}) }) + describe('GET /', () => { + it('should redirect to main site', async () => { + const resp = await request(app.callback()).get('/') + expect(resp.status).to.eq(302) + expect(resp.headers.location).to.eq('https://status.im/') + }) + }) + describe('GET /health', () => { it('should return OK', async () => { const resp = await request(app.callback())