2016-08-26 14:19:03 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const path = require('path');
|
2016-08-30 15:07:53 +02:00
|
|
|
const sendfile = require('koa-sendfile');
|
|
|
|
const _ = require('lodash');
|
2016-08-26 14:19:03 +02:00
|
|
|
/**
|
|
|
|
* A set of functions called "actions" for `Admin`
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
index: function *() {
|
2016-11-22 12:05:02 +01:00
|
|
|
// Send the HTML file with injected scripts
|
|
|
|
this.body = strapi.plugins.admin.services.admin.generateAdminIndexFile();
|
2016-08-26 14:19:03 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
file: function *() {
|
|
|
|
yield sendfile(this, path.resolve(__dirname, '..', 'public', 'build', this.params.file));
|
|
|
|
if (!this.status) this.throw(404);
|
|
|
|
}
|
|
|
|
};
|