Created
September 22, 2017 23:45
-
-
Save gpbaculio/d7abbf71f838719608a7145d95c649d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = express(); | |
const indexPath = path.join(__dirname, './public/index.html') | |
const publicPath = express.static(path.join(__dirname, './public')) | |
app.use('/public', publicPath) | |
app.use('/graphql', graphQLHTTP({graphiql: true, schema, pretty: true})); // graphql endpoint | |
app.get('/', function (_, res) { res.sendFile(indexPath) }); | |
let http = require('http'); | |
let server = http.createServer(app); | |
server.listen(4000, () => console.log("app in 4000")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment