Re: Couch on port 80

2015-11-19 Thread Martin Broerse
Hi Alexander,

It seems you can run 2 mochiweb servers to bind to 80 and 5984. See:
https://github.com/mochi/mochiweb/issues/163#event-468943815

This seems more logical than using 2 clusters for this.

By the way: The are 72962 downloads since 2015-07-09 for hMailserver (
https://www.hmailserver.com/download) so Windows Intranet use is not little
in my opinion. I like Linux more than Windows in the cloud but I rarely see
Linux/BSD systems on customers Intranets. I know we can run everything on
Cloudant but not every company likes to have their data in the cloud.
Companies running Intranets like this are willing to switch from Excel to
CouchDB but I don't think they want to maintain a Linux server to do this.

- Martin



On Wed, Nov 18, 2015 at 10:54 PM, Alexander Shorin  wrote:

> Hi Martin,
>
> On Thu, Nov 19, 2015 at 12:50 AM, Martin Broerse 
> wrote:
> > It seems there is also something in CouchDB called mochiweb that can be
> > improved to support multiple ports.
>
> Ah, you mean binding to multiple ports. Sorry, I misunderstood you.
> Well, this is not possible too since such feature isn't supported by
> our webserver.
>
> > Perhaps even better, there will be cluster support in 2.0 so perhaps we
> can
> > setup 3 clusters by default and using port 80 , 443 and 5984 for the
> windows
> > friends ;-).
>
> Interesting trick (:
>
> --
> ,,,^..^,,,
>


Re: serving html pages built from multiple lists or shows

2015-11-19 Thread Harald Kisch
In my opinion, groupware is done right with couchapps!

Cheers
--Harald

On Wed, Nov 18, 2015 at 11:53 PM, Nick  wrote:

> On 18/11/15 22:21, Alexander Shorin wrote:
> > For the case you described the following strategy is used:
> > 1. User requests some ddoc attachment like index.html
> > 2. There you make XHR requests to CouchDB for the HTML fragments or raw
> data
> > 3. Compose responses on the page via JS
>
> Thanks - which indeed implies I am right and there is no solution that
> works
> without JS on the client...
>
> Cheers
>
> N
>



-- 

Dipl.-Inf. Harald R. Kisch

Büro besetzt von Di - Do 9:00 Uhr bis 18:00 Uhr
Jahnstr. 3
80469 München
Germany

Tel: +49 (0) 89 41 61 58 57-6
Mobil DE: +49 (0) 176 56 58 58 38

Skype: harald.kisch
Mail: haraldki...@gmail.com


Re: serving html pages built from multiple lists or shows

2015-11-19 Thread Harald Kisch
> return Handlebars.precompile(item.data)

item.data = template.html; // inside with {{someAttribute}}
var obj = { someAttribute:someValue },
  precompile =  Handlebars.compile(item.data);
return precompile(obj);

works
--Harald

On Thu, Nov 19, 2015 at 5:17 AM, ermouth  wrote:

> > I think it should be possible to use  ermouth's ddoc.me to obtain the
> same
> > result much more easily. Maybe he can speak for us..
>
> Since Ddoc Lab can post-process each item with individual code for an item,
> you can precompile your data in any suitable way before publishing. You can
> even keep you templates in external docs – Ddoc Lab is able to fetch
> externals before processing.
>
> To have handlebars inside Ddoc Lab document, you should:
>
>- create any code snippet, it can be dummy
>- mark it as having postprocessor
>- put HB code into postprocessor and make pre-checker wrapper, which
>will prevent HB init, if it was already initialized
>
> Now each postprocessor have access to window.Handlebar. This approach is
> usefull for other libs also.
>
> So to have your template precompiled, just write a template and
> postprocessor for it (think `return Handlebars.precompile(item.data)` –
> will be enough).
>
> ermouth
>
> 2015-11-19 4:52 GMT+03:00 Giovanni Lenzi :
>
> > Hi Robin and Nick,
> > You definitely CAN output full html, non js, SEO optimized web pages. We
> > use that for our store index and apps pages (on
> > https://www.smileupps.com/store).
> >
> > We needed to:
> > 1. create html templates of your pages with a templating library(we used
> > handlebars.js),
> > 2. precompile these templates before 'couchapp push' as server side
> > javascript file in ddoc, such as lib/templates.js
> > 3. create a view with name(path) of your page as key, emitting documents
> > containing information of a same page under the same key. These elements
> > may be html for header, links for navigation bar, markdown or raw html
> for
> > your page content, a list of apps, or anything else
> > 4. create a list which uses:
> > - getrow() to fetch above elements in memory,
> > - var tpls=require(lib/templates),
> > - obtain html by merging templates and documents:
> > htmlforheader=tpls.header(headerdocument),
> > htmlfornavbar=tpls.navbar(linksdocuments)
> > - return/output html from the list function
> >
> > Probably the most difficult part is to precompile correctly those
> > templates, in a way you can use them server side withouth issues. We
> used a
> > node.js handlebar precompiler automatically run before 'couchapp push',
> but
> > I think it should be possible to use  ermouth's ddoc.me to obtain the
> same
> > result much more easily. Maybe he can speak for us..
> >
> > Hope this helps,
> > --Giovanni
> > Il giorno 19/nov/2015 00:13, "Robin Millette"  ha
> > scritto:
> >
> > > Hi,
> > >
> > > First time writing to this list, or any couchdb list for that matter.
> > > Hope to see a brillant couchapp (the concept) revival in 2016!
> > >
> > > On Wed, Nov 18, 2015 at 5:53 PM, Nick 
> > wrote:
> > >
> > > > Thanks - which indeed implies I am right and there is no solution
> that
> > > works
> > > > without JS on the client...
> > >
> > > I also prefer to send complete html responses, for SEO and general
> > > crawling benefits.
> > > One strategy I used was to craft views to output different kinds of
> > > rows. For instance, you've got you main content row, and you can also
> > > have "block" rows, to pepper your html page with.
> > > The list fonction can then handle those different row types and
> > > generate proper html.
> > >
> > >
> > > --
> > > Robin
> > >
> >
>


Re: serving html pages built from multiple lists or shows

2015-11-19 Thread ermouth
> If you could find the time to do a screen recording of what you just
described

https://www.youtube.com/watch?v=_FoI2An3JRc
Bit messy since it‘s impromptu

ermouth