How to add rewrites to design doc?
akralj opened this issue · comments
Hallo,
I need to add rewrites to the design doc, which I do manually at the moment. the result should look like this:
{
"_id": "_design/kunstgutapp",
"_rev": "10-281f6cdb36249481196c84ed25389140",
"kanso": {
"config": {
"name": "kunstgutapp",
"version": "0.1.0",
"description": "First Preview of Kunstgut App",
"attachments": [
"index.html",
"bundle.js",
"bundle.css",
"assets/img/imagePlaceholder.jpg",
"favicon.ico"
],
"dependencies": {
"attachments": null
},
"minify": false
},
"build_time": "2015-03-12T17:07:36Z",
"kanso_version": "0.4.1",
"push_time": "2015-03-12T17:07:58Z",
"pushed_by": "akralj"
},
"rewrites": [
{
"from": "/",
"to": "/index.html"
},
{
"from": "/*",
"to": "/*"
}
],
"_attachments": {
"index.html": {
"content_type": "text/html",
"revpos": 9,
"digest": "md5-JFQugX4U4RUG9ejwRVG2sA==",
"length": 21719,
"stub": true
},
"bundle.js": {
"content_type": "application/javascript",
"revpos": 9,
"digest": "md5-0YM3SoBDRTX+okFNxHv98w==",
"length": 5626931,
"stub": true
},
"bundle.css": {
"content_type": "text/css",
"revpos": 9,
"digest": "md5-84F94YjWOQuc6Erdd2vTjA==",
"length": 200593,
"stub": true
},
"assets/img/imagePlaceholder.jpg": {
"content_type": "image/jpeg",
"revpos": 9,
"digest": "md5-zNJfGpCJWc9x68RvkDmNDg==",
"length": 60016,
"stub": true
},
"favicon.ico": {
"content_type": "image/x-icon",
"revpos": 9,
"digest": "md5-/SNxT/Naj+Ogd5mebYpKuQ==",
"length": 446,
"stub": true
}
}
}
I tried putting it in kanso.json, but of course it shows under kanso: config:
So any help is highly appreciated
thanks a lot
andrej
Check out the modules package:
http://kan.so/docs/Using_CommonJS_modules
http://kan.so/packages/details/modules
Example app: https://github.com/kanso/kanso-tasks
i am able to achieve this the following way:
./lib/app.js
module.exports = {
shows: require('./shows'),
lists: require('./lists'),
views: require('./views'),
updates: require('./updates'),
filters: require('./filters'),
rewrites: require('./rewrites'),
validate_doc_update: require('./validate'),
synoptic: require('./synoptic')
};
./lib/rewrites.js
module.exports = [
{
"from": "",
"to": "/index.html",
"method": "GET",
"query": {}
},
{
"from": "/index.html",
"to": "/index.html",
"method": "GET",
"query": {}
}
];
In kanso.json include:
"modules": ["lib"]
On Fri, Mar 13, 2015 at 2:39 AM, andrej notifications@github.com wrote:
Hallo,
I need to add rewrites to the design doc, which I do manually at the
moment. the result should look like this:{
"_id": "design/kunstgutapp",
"rev": "10-281f6cdb36249481196c84ed25389140",
"kanso": {
"config": {
"name": "kunstgutapp",
"version": "0.1.0",
"description": "First Preview of Kunstgut App",
"attachments": [
"index.html",
"bundle.js",
"bundle.css",
"assets/img/imagePlaceholder.jpg",
"favicon.ico"
],
"dependencies": {
"attachments": null
},
"minify": false
},
"build_time": "2015-03-12T17:07:36Z",
"kanso_version": "0.4.1",
"push_time": "2015-03-12T17:07:58Z",
"pushed_by": "akralj"
},
"rewrites": [
{
"from": "/",
"to": "/index.html"
},
{
"from": "/",
"to": "/"
}
],
"_attachments": {
"index.html": {
"content_type": "text/html",
"revpos": 9,
"digest": "md5-JFQugX4U4RUG9ejwRVG2sA==",
"length": 21719,
"stub": true
},
"bundle.js": {
"content_type": "application/javascript",
"revpos": 9,
"digest": "md5-0YM3SoBDRTX+okFNxHv98w==",
"length": 5626931,
"stub": true
},
"bundle.css": {
"content_type": "text/css",
"revpos": 9,
"digest": "md5-84F94YjWOQuc6Erdd2vTjA==",
"length": 200593,
"stub": true
},
"assets/img/imagePlaceholder.jpg": {
"content_type": "image/jpeg",
"revpos": 9,
"digest": "md5-zNJfGpCJWc9x68RvkDmNDg==",
"length": 60016,
"stub": true
},
"favicon.ico": {
"content_type": "image/x-icon",
"revpos": 9,
"digest": "md5-/SNxT/Naj+Ogd5mebYpKuQ==",
"length": 446,
"stub": true
}
}
}I tried putting it in kanso.json, but of course it shows under kanso:
config:
So any help is highly appreciated
thanks a lot
andrej—
Reply to this email directly or view it on GitHub
#425.
Ronald Ranauro
Incite Advisors, Inc.
Web: www.inciteadvisors.com
Open Source: http://boxspringjs.org
Email: ron@inciteadvisors.com
Phone: (508) 254-8349
Yep that works!