mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-06-03 16:02:31 +02:00
18 lines
448 B
JavaScript
18 lines
448 B
JavaScript
const path = require('path')
|
|
const express = require('express')
|
|
const config = require('config')
|
|
const graphqlApp = require('./graphqlApp')
|
|
const buildPath = path.join(__dirname, '../../apolloui/build');
|
|
|
|
const app = express()
|
|
|
|
app.use('/api/graphql', graphqlApp)
|
|
|
|
if (process.env.NODE_ENV === 'production') app.use(express.static(buildPath));
|
|
|
|
app.get('*', function (req, res) {
|
|
res.sendFile(buildPath + '/index.html');
|
|
});
|
|
|
|
module.exports = app
|