{"size": 520, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "prasunk96/graphql-server", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server.js", "max_issues_repo_name": "prasunk96/graphql-server", "max_issues_repo_issues_event_min_datetime": "2021-05-11T22:35:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-11T22:35:34.000Z", "max_forks_repo_path": "server.js", "max_forks_repo_name": "prasunk96/graphql-server", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 27.3684210526, "max_line_length": 75, "alphanum_fraction": 0.6807692308}
let express = require('express');
let { graphqlExpress, graphiqlExpress } = require('apollo-server-express');
let bodyParser = require('body-parser');
let schema = require('./src/schema.js');
let cors = require('cors')

const GRAPHQL_PORT = 3100;

const app = express();

app.use(cors());
app.use('/graphql', bodyParser.json(), graphqlExpress({ schema }));
app.use('/', graphiqlExpress({ endpointURL: '/graphql' }));

app.listen(process.env.PORT || GRAPHQL_PORT, () =>
  console.log(
    `GraphiQL is now running`
  )
);