Skip to content

Site to render pages via npo pages api

Notifications You must be signed in to change notification settings

npo-poms/npoapi-pages

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rendering a site via the pages api

The NPO pages api is actually meant to facilitate searching in your site.

The objects it contains are quite complete though. This is a simple demo on how it could be used to actually serve a site via it.

It is implemented with python flask.

Running

The makefile documents how to run it.

The app can be configured with the following environment variables:

  • secret: The NPO api secret

  • apiKey: The NPO apiKey. This defaults to key of vpro

  • origin: The NPO origin. This defaults to https://www.vpro.nl

  • profile: The profile to base the site on. Defaults to vpro

  • configdir: Set this to the cwd to get mentioned defaults working

Set up pyapi, with flask (pip install flask) and run

export secret=<see 1password or so>
configdir=$(pwd) profile=vpro flask run

I prepared a docker image with required dependencies too:

docker run --env secret=${secret} --env profile=vpro -p 8080:8080  mihxil/npoapi-pages

Via make:

make docker-run PROFILE=vpro

(it should be pulled from hub.docker.io. Nothing else needed. Just keep port 8080 free.)

About

Site to render pages via npo pages api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 43.4%
  • Python 39.2%
  • CSS 9.3%
  • Makefile 5.6%
  • Dockerfile 2.5%