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): add chalk, fix SSR express's handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Metnew committed Aug 4, 2017
1 parent 8a360a2 commit cbcb966
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/server/server.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import app from './express'
import API from './api'
import useSSR from './ssr'
// see src/server/index.js
const {PORT, BASE_API} = process.env
import chalk from 'chalk'

const {BASE_API, PORT} = process.env
// Add API route
app.use(BASE_API, API)
// Add SSR handler
app.get('*', useSSR)
app.use(useSSR)
// Start server
app.listen(PORT, () => {
console.log(`Server is running on ${PORT} port!`)
console.log(chalk.green(`\nServer is running on ${PORT} port!\n`))
})

0 comments on commit cbcb966

Please sign in to comment.