On Apr 22, 2014, at 11:34 AM, Tres Seaver <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 04/22/2014 08:53 AM, Achim Domma wrote:
>
>> Service and UI will be served from the same domain, so that I don't
>> have to care about cross domain access stuff like CORS. I would like
>> to have the same for my development system, so I would have to
>> "build" the Javasript files into my Pyramid project.
>
> You don't necessarily need to have the front-end artifacts in the same
> place. For instance, I've added a minimal Python stub to the JS/CSS
> checkout for one project. It has a 'setup.py':
>
> $ cd /path/to/frontend
> $ cat setup.py
> from setuptools import find_packages
> from setuptools import setup
>
> setup(name='frontend',
> version="0.1",
> description='Angular frontend',
> packages=find_packages(),
> include_package_data=True,
> zip_safe=False,
> )
>
> and an almost-empty Python package:
>
> $ cat frontend/__init__.py
> def includeme(config):
> config.add_static_view(name='frontend', path='../src')
> # Let other apps reuse our library aassets.
> config.add_static_view(name='lib', path='../src/lib')
>
> The Angular app is in 'src', and the external dependecies are in
> 'src/lib'.
>
> I then pull in its static views via 'config.include("frontend")' in
> my Pyramid app.
Tres and I used this on a recent project. I also used Angular's mock
httpService to write most of the REST API (GET/POST/PUT/DELETE) as an
in-browser mocked service. Tres then came back and converted everything to
Cornice once the customer liked how it acted. Worked quite well.
I would be interested in making an Angular-Pyramid scaffold. I just can't tell
if it should be friendly to Angular people (Grunt/Bower/npm etc.) or Pyramid
people regarding bootstrapping.
--Paul
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.