Wikimedia Apps/Team/RESTBase services for apps/Notes

Routes
All routes start with {domain}/[...]v1/page:

Not actively developed

 * mobile-html (pure HTML, going away)
 * mobile-text (for Lite app)

Active development

 * mobile-html-sections
 * mobile-html-sections-lead
 * mobile-html-sections-remaining

Production (Service Cluster B)
https://en.wikipedia.org/api/rest_v1/page/mobile-html-sections/Munich https://en.wikipedia.org/api/rest_v1/page/mobile-html-sections-lead/Munich https://en.wikipedia.org/api/rest_v1/page/mobile-html-sections-remaining/Munich

Labs (appservice.wmflabs.org)
http://appservice.wmflabs.org/en.m.wikipedia.org/v1/page/mobile-html-sections/Munich http://appservice.wmflabs.org/en.m.wikipedia.org/v1/page/mobile-html-sections-lead/Munich http://appservice.wmflabs.org/en.m.wikipedia.org/v1/page/mobile-html-sections-remaining/Munich

Local dev environment
http://localhost:6927/en.wikipedia.org/v1/page/mobile-html-sections/Munich http://localhost:6927/en.wikipedia.org/v1/page/mobile-html-sections-lead/Munich http://localhost:6927/en.wikipedia.org/v1/page/mobile-html-sections-remaining/Munich

Discuss

 * sections[] split between lead + remaining
 * extra properties for lead:
 * lead image
 * first infobox as JSON object,
 * text extracts,
 * pronunciation,
 * spokenWikipedia,
 * geo,
 * media {images, videos}
 * mobile-html-sections-lead: should we have a mobile-preview route?

Architecture/Data Flow
RESTBase is the infrastructure which is hosting our Node.js service. Parallel requests to backend services:
 * action=mobileview
 * parsoid (soon)
 * gen=images -> prop=imageinfo | prop=videoinfo
 * extract

Development/Nodejs

 * Node.js service, Express app
 * Parallel requests to backend services via Promises

Important commands
npm install npm start npm test npm run-script coverage rm -rf node_modules

Files/folders of note

 * spec.yaml (Swagger spec, x-amples)
 * app.js (initApp, loadRoutes, createServer)
 * routes/mobile-html-sections.js (version 1, routes, promises)
 * lib/transforms.js (domino)
 * lib/mwapi.js
 * test/mobile-html-sections/pagecontent.js (describe.only)

Edit/debug
IntelliJ + Node.js plugin (WebStorm), any editor with JS syntax highlighting would do just fine

Use a lot of  for debugging (sometimes with   or pretty  ). Can't use  for DOM elements due to the circular nature of DOM. is not a ton of help but may be a start.

Enable it from the app / roll-out to Android Beta app
Settings/Developer options/

Node.js Developers also change.