0

How do I implement a nodejs based rest-api using KOA as web framework using the davezuko' provided boilerplate. Where do I put the codes for that? Is there any example?

I see under config/environments.js this snippet but I do not understand

// Here is where you can define configuration overrides based on the execution environment.
// Supply a key to the default export matching the NODE_ENV that you wish to target, and
// the base configuration will apply your overrides before exporting itself.
export default {
  // ======================================================
  // Overrides when NODE_ENV === 'development'
  // ======================================================
  // NOTE: In development, we use an explicit public path when the assets
  // are served webpack by to fix this issue:
  // http://stackoverflow.com/questions/34133808/webpack-ots-parsing-error-loading-fonts/34133809#34133809
  development: (config) => ({
    compiler_public_path: `http://${config.server_host}:${config.server_port}/`,
    proxy: {
      enabled: false,
      options: {
        host: 'http://localhost:8000',
        match: /^\/api\/.*/
      }
    }
  }),

  // ======================================================
  // Overrides when NODE_ENV === 'production'
  // ======================================================
  production: (config) => ({
    compiler_public_path: '/',
    compiler_fail_on_warning: false,
    compiler_hash_type: 'chunkhash',
    compiler_devtool: null,
    compiler_stats: {
      chunks: true,
      chunkModules: true,
      colors: true
    }
  })
}
fefe
  • 8,755
  • 27
  • 104
  • 180
  • 1
    I don't know the answer but perhaps this blog post will assist you in setting up koa react redux http://blog.joanboixados.com/building-a-boilerplate-for-a-koa-redux-react-application-including-webpack-mocha-and-sass/ – Alexei Darmin May 20 '16 at 11:30
  • Possible duplicate of [davezuko/react-redux-starter-kit create nodejs api endpoints. How to?](http://stackoverflow.com/questions/37194292/davezuko-react-redux-starter-kit-create-nodejs-api-endpoints-how-to) – NickGnd Jul 07 '16 at 14:38

0 Answers0