mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
return something on root of commons server
This commit is contained in:
parent
039f5da189
commit
1ea527f2d1
@ -3,6 +3,7 @@ import express from 'express'
|
||||
import compression from 'compression'
|
||||
import morgan from 'morgan'
|
||||
import bodyParser from 'body-parser'
|
||||
import pkg from '../../package.json'
|
||||
|
||||
// routes
|
||||
import UrlCheckRouter from './routes/UrlCheckRouter'
|
||||
@ -51,6 +52,15 @@ app.use(bodyParser.urlencoded({ extended: false }))
|
||||
app.use(compression())
|
||||
|
||||
// routes
|
||||
app.get('/', (req, res) => {
|
||||
res.send(
|
||||
`<strong><code>
|
||||
🏄♀️ <br />
|
||||
Ocean Protocol Commons Server v${pkg.version}<br />
|
||||
<a href="https://github.com/oceanprotocol/commons" style="text-decoration:none;color:#f6388a">github.com/oceanprotocol/commons</a>
|
||||
</code></strong>`
|
||||
)
|
||||
})
|
||||
app.use('/api/v1/urlcheck', UrlCheckRouter)
|
||||
|
||||
/// catch 404
|
||||
|
@ -5,6 +5,13 @@ afterAll(done => {
|
||||
server.close(done)
|
||||
})
|
||||
|
||||
describe('GET /', () => {
|
||||
it('responds with success', async () => {
|
||||
const response = await request(server).get('/')
|
||||
expect(response.statusCode).toBe(200)
|
||||
})
|
||||
})
|
||||
|
||||
describe('POST /api/v1/urlcheck', () => {
|
||||
it('responds with json', async () => {
|
||||
const response = await request(server).post('/api/v1/urlcheck')
|
||||
|
@ -2,6 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"resolveJsonModule": true,
|
||||
"target": "es6",
|
||||
"noImplicitAny": false,
|
||||
"moduleResolution": "node",
|
||||
|
Loading…
Reference in New Issue
Block a user