(file)
| 237 | |
| 238 | const templates = {}; |
| 239 | const getStaticTemplate = function(file) { |
| 240 | // Don't cache templates in development so you can just edit then. |
| 241 | if (templates[file] && config.isProduction) { return templates[file]; } |
| 242 | return templates[file] = fs.readFileAsync(path.join(publicPath, 'templates', 'static', file), 'utf8'); |
| 243 | }; |
| 244 | |
| 245 | const renderMain = wrap(function*(template, req, res) { |
| 246 | template = yield getStaticTemplate(template); |