* fix: eslint warnings * refactor: use ramda + sanctuary instead of lodash * refactor: use prettier-standard for formatting * feat: enable security * feat: add graphql * chore: remove trailing commas from linter * docs: new scripts on react and new-admin-server * feat: handle authentication on graphql * fix: perf improvement to date picker * chore: add insecure-dev script to run servers
23 lines
528 B
JavaScript
23 lines
528 B
JavaScript
const bodyParser = require('body-parser')
|
|
const express = require('express')
|
|
const { ApolloServer } = require('apollo-server-express')
|
|
|
|
const { typeDefs, resolvers } = require('./graphql/schema')
|
|
|
|
const app = express()
|
|
const server = new ApolloServer({
|
|
typeDefs,
|
|
resolvers
|
|
})
|
|
|
|
server.applyMiddleware({ app })
|
|
|
|
app.use(bodyParser.json())
|
|
|
|
function run () {
|
|
const serverLog = `lamassu-admin-server listening on port ${8080}${server.graphqlPath}`
|
|
|
|
app.listen(8080, () => console.log(serverLog))
|
|
}
|
|
|
|
module.exports = { run }
|