# Logical Layer App Service

The logical layer of the Weixin Mini Program development framework uses theJavaScriptengine to provide Mini Programs with the runtime environment for the development ofJavaScript]]code and the exclusive functionality of Weixin Mini Program.

The logic layer sends the data to the view layer after it has been processed and receives event feedback from the view layer.

All code written by a developer will eventually be packaged into aJavaScriptfile and run when Weixin Mini Program starts until the Mini Program is destroyed.This behavior is similar to ServiceWorker , so the logical layer is also called App Service.

In addition toJavaScript, we have added some features to facilitate Weixin Mini Program development:

  • AddAppAnd thePagemethod performs the program registration and the page registration .
  • Add thegetAppandgetCurrentPagesmethods to obtain theAppinstance and the current page stack, respectively.
  • Provides a rich API ,Such as WeChat user data, scan, pay and other WeChat specific capabilities.
  • Provides Modularization capability, and each page has an independent scope .

Note: The Weixin Mini Program framework's logical layer does not run in a browser, so JavaScriptis not available on the web, such as `` window,document`etc.