# Logical layer App Service

The use of logic layer in Mini Programs development framework JavaScript Engine provides development for Mini Programs JavaScript The operating environment of the code and the unique functions of the WeChat Mini Program.

The logic layer sends the data to the view layer after processing, and receives the event feedback from the view layer at the same time.

All the code written by the developer will eventually be packaged into a JavaScript File, and run it when the Mini Program is started until the Mini Program is destroyed. This behavior is similar ServiceWorker , so the logical layer is also called App Service。

in JavaScript On the basis of this, we have added some functions to facilitate the development of Mini programs:

  • increase App and Page Method, carry outProgram RegistrationandPage Registration
  • increase getApp and getCurrentPages Method, respectively, used to get the App Instance and the current page stack.
  • Provide a wealth of API, such as WeChat user data, scan, pay and other WeChat specific capabilities.
  • providemodularityCapabilities, each page has an independent[Scope](./module.md#File scope)。

Note that the logical layer of the Mini Program framework does not run in a browser, so JavaScript in web Some of the capabilities are not available, such as windowdocument Etc.