mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
19 lines
359 B
JavaScript
19 lines
359 B
JavaScript
|
|
import express from 'express'
|
||
|
|
import graphqlHTTP from 'express-graphql'
|
||
|
|
import schema from './schema'
|
||
|
|
|
||
|
|
const app = express()
|
||
|
|
|
||
|
|
app.use('/graphql', graphqlHTTP({
|
||
|
|
schema,
|
||
|
|
graphiql: true,
|
||
|
|
formatError: error => ({
|
||
|
|
message: error.message,
|
||
|
|
statusCode: error.statusCode,
|
||
|
|
locations: error.locations,
|
||
|
|
stack: error.stack
|
||
|
|
})
|
||
|
|
}))
|
||
|
|
|
||
|
|
app.listen(3001)
|