@platform/react.ssr
Version:
A lightweight SSR (server-side-rendering) system for react apps bundled with ParcelJS and hosted on S3.
25 lines (24 loc) • 786 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var common_1 = require("../common");
var config_1 = require("../config");
var routes = require("./routes");
function create(args) {
var manifestUrl = args.manifestUrl, baseUrl = args.baseUrl;
var app = common_1.micro.init({
log: {
manifest: manifestUrl,
base: baseUrl,
},
});
routes.init({ router: app.router, manifestUrl: manifestUrl, baseUrl: baseUrl });
return app;
}
exports.create = create;
function fromConfig() {
var config = config_1.Config.createSync();
var manifestUrl = config.manifest.s3.url;
var baseUrl = config.baseUrl;
return create({ manifestUrl: manifestUrl, baseUrl: baseUrl });
}
exports.fromConfig = fromConfig;