diff --git a/server.js b/server.js index 38b78522..8f0282aa 100644 --- a/server.js +++ b/server.js @@ -1,4 +1,3 @@ -const path = require('path') const express = require('express') const next = require('next') const cors = require('cors') @@ -7,29 +6,29 @@ const gitApi = require('@tinacms/api-git') const port = parseInt(process.env.PORT, 10) || 3000 const dev = process.env.NODE_ENV !== 'production' const app = next({ - dev, - dir: './src' + dev, + dir: './src', }) const handle = app.getRequestHandler() app.prepare().then(() => { - const server = express() + const server = express() - server.use(cors()) - server.use( - '/___tina', - gitApi.router({ - pathToRepo: path.join(process.cwd(), '../..'), - pathToContent: 'src' - }) - ) + server.use(cors()) + server.use( + '/___tina', + gitApi.router({ + pathToRepo: process.cwd(), + pathToContent: '', + }) + ) - server.all('*', (req, res) => { - return handle(req, res) - }) + server.all('*', (req, res) => { + return handle(req, res) + }) - server.listen(port, err => { - if (err) throw err - console.log(`> Ready on http://localhost:${port}`) - }) + server.listen(port, err => { + if (err) throw err + console.log(`> Ready on http://localhost:${port}`) + }) })