Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
feat(src/server/server): server use env vars PORT and BASE_API
Browse files Browse the repository at this point in the history
  • Loading branch information
Metnew committed Jul 15, 2017
1 parent a9b83f8 commit 1d50a6f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/server/server.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import app from './express'
import API from './api'
import useSSR from './ssr'

const httpPort = process.env.PORT || 3000

// add handler for non-static requests
app.use('/api/v1', API)
// SSR
// see src/server/index.js
const {PORT, BASE_API} = process.env
// Add API route
app.use(BASE_API, API)
// Add SSR handler
app.get('*', useSSR)

app.listen(httpPort, () => {
// Start server
app.listen(PORT, () => {
console.log(`SSR ON PORT ${httpPort}! SSR!`)
})

0 comments on commit 1d50a6f

Please sign in to comment.