redirect root to status.im site

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-08-16 19:43:58 +02:00
parent 0dd5915fd8
commit 86b1688217
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 13 additions and 1 deletions

View File

@ -1 +1 @@
require('./src/app.js')
require('./src/index.js')

View File

@ -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'
})

View File

@ -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())