mirror of
https://github.com/sergeyyarkov/next-apollo-graphql-setup.git
synced 2026-10-11 10:19:43 +03:00
17 lines
352 B
JavaScript
17 lines
352 B
JavaScript
const express = require('express')
|
|
const graphqlHTTP = require('express-graphql')
|
|
const schema = require('../schema/schema')
|
|
const cors = require('cors')
|
|
|
|
const app = express()
|
|
|
|
app.use(cors())
|
|
app.use('/graphql', graphqlHTTP({
|
|
schema,
|
|
graphiql: true
|
|
}))
|
|
|
|
const PORT = 3005
|
|
app.listen(PORT, () => console.log(`Server listen port ${PORT}...`))
|
|
|