<commit_before>import app from './express'
import API from './api'
import useSSR from './ssr'
import chalk from 'chalk'

const {BASE_API, PORT} = process.env
// Add API route
app.use(BASE_API, API)
// Add SSR handler
app.use(useSSR)
// Start server
app.listen(PORT, () => {
	console.log(chalk.magenta(`\nServer is running on ${PORT} port!\n`))
})<commit_msg>feat(src/server): add `server.js` which mounts middlewares, ssr, api<commit_after>/*
 * @flow
 */
import addMiddlewares from './middlewares'
import API from './api'
import SSR from './ssr'
import fetch from 'isomorphic-fetch'

global.fetch = fetch

/**
 * Mount API, SSR and middlewares to app.
 * @param  {Object} app - Express server instance
 * @return {Object}     - Decorated server instance
 */
export default (app: Object): Object => {
	// Add global middlewares
	addMiddlewares(app)
	// Add API
	app.use('/api/v1', API)
	// Add SSR
	app.use(SSR)
	return app
}
{'fraction_non_alphanumeric': 0.15027027027027026, 'fraction_numerical': 0.001081081081081081, 'mean_word_length': 3.7979274611398965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '471624', 'n_tokens_mistral': 325, 'n_tokens_neox': 317, 'n_words': 101}