UNPKG

783 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var path = require("path");
4var cordova_config_1 = require("../util/cordova-config");
5/**
6 * Main Lab app view
7 */
8exports.LabAppView = function (req, res) {
9 return res.sendFile('index.html', { root: path.join(__dirname, '..', '..', 'lab') });
10};
11exports.ApiCordovaProject = function (req, res) {
12 cordova_config_1.buildCordovaConfig(function (err) {
13 res.status(400).json({ status: 'error', message: 'Unable to load config.xml' });
14 }, function (config) {
15 res.json(config);
16 });
17};
18exports.ApiPackageJson = function (req, res) {
19 res.sendFile(path.join(process.cwd(), 'package.json'), {
20 headers: {
21 'content-type': 'application/json'
22 }
23 });
24};