{"_id":"@crabas0npm/quo-neque-delectus","name":"@crabas0npm/quo-neque-delectus","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@crabas0npm/quo-neque-delectus","version":"1.0.0","description":"<!-- Status Badges & Important Links -->","main":"index.js","author":{"name":"Crabas0"},"license":"MIT","dependencies":{"@crabas0npm/accusantium-repellendus-sint-consequuntur":"^1.0.0","@crabas0npm/alias-consequuntur-hic-enim":"^1.0.0","@crabas0npm/aliquid-vitae-magnam-perspiciatis":"^1.0.0","@crabas0npm/aut-cupiditate-quam-dicta":"^1.0.0","@crabas0npm/blanditiis-est-molestias-a":"^1.0.0","@crabas0npm/consectetur-impedit-exercitationem-error":"^1.0.0","@crabas0npm/corporis-rerum-reprehenderit-voluptates":"^1.0.0","@crabas0npm/delectus-dolorem-consectetur-corrupti":"^1.0.0","@crabas0npm/ea-nisi-earum-mollitia":"^1.0.0","@crabas0npm/et-perspiciatis-eius-modi":"^1.0.0","@crabas0npm/expedita-magnam-quia-perferendis":"^1.0.0","@crabas0npm/expedita-optio-recusandae-nesciunt":"^1.0.0","@crabas0npm/expedita-voluptas-corrupti-ullam":"^1.0.0","@crabas0npm/facilis-doloribus-provident-optio":"^1.0.0","@crabas0npm/fugiat-necessitatibus-recusandae-quo":"^1.0.0","@crabas0npm/maxime-sequi-nam-facere":"^1.0.0","@crabas0npm/minus-iure-ipsum-temporibus":"^1.0.0","@crabas0npm/nulla-minima-vero-facere":"^1.0.0","@crabas0npm/odio-exercitationem-ducimus-provident":"^1.0.0","@crabas0npm/officia-nostrum-at-hic":"^1.0.0","@crabas0npm/officiis-labore-tempora-sint":"^1.0.0","@crabas0npm/omnis-neque-asperiores-rerum":"^1.0.0","@crabas0npm/optio-sequi-optio-quidem":"^1.0.0","@crabas0npm/porro-voluptatem-consectetur-beatae":"^1.0.0","@crabas0npm/possimus-sit-repellat-perspiciatis":"^1.0.0","@crabas0npm/quo-dolorem-molestiae-porro":"^1.0.0","@crabas0npm/ratione-nisi-deleniti-provident":"^1.0.0","@crabas0npm/ratione-voluptatibus-quo-sed":"^1.0.0","@crabas0npm/repellendus-illum-cum-fugit":"^1.0.0","@crabas0npm/unde-quos-asperiores-modi":"^1.0.0","@diahkomalasarinpm/praesentium-sint-dolorem":"^1.0.0","@f1stnpm2/adipisci-adipisci-praesentium":"^1.0.0","@wemnyelezxnpm/delectus-repellendus-neque":"^1.0.0"},"keywords":["packages","performance","bootstrap less","Microsoft","curried","xdg","remove","spawn","take","arguments","three","operating-system","website","date","ava","authentication","input","asserts","gradients css3","typed","quote","omit","defineProperty","create","chinese","has","electron","tester","logger","fetch","group","classname","limited","javascript","irq","dayjs","babel-core","deepclone","limit","classes","names","prefix","matches","getintrinsic","emit","install","property","ponyfill","hasOwn","walking","eventEmitter","l10n","columns","jwt","css nesting","shared","accessor","uuid","eventDispatcher","superagent","regular expression","macos","class-validator","crypt","react-hook-form","joi","Promise","Object.values","stylesheet","scheme","terminal","colors","once","every","json","mocha","up","ender","animation","Object.entries","getPrototypeOf","safe","babel","Int16Array","tdd","find"],"repository":{"type":"git","url":"git+https://github.com/crabas0npm/quo-neque-delectus.git"},"homepage":"https://github.com/crabas0npm/quo-neque-delectus/#readme","bugs":{"url":"https://github.com/crabas0npm/quo-neque-delectus/issues"},"packageManager":"yarn@4.1.1","_id":"@crabas0npm/quo-neque-delectus@1.0.0","gitHead":"8e33bf6d975f6f8ca8f08473ff853d5c4686bb69","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-gPen6XWXdLx9gT4t9lLMDB2IhKzNFHz4NAWgAmWDMN/w30gjPcyEFuyfSAIypiUkXN1ktRijtCdTWxGRiMUF4Q==","shasum":"4a1ae9ac81b5257490109cbdb9b4db2343d537d6","tarball":"https://registry.npmjs.org/@crabas0npm/quo-neque-delectus/-/quo-neque-delectus-1.0.0.tgz","fileCount":10,"unpackedSize":53524,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC/XP8K24QmMiPkiBtv5i27QQZu5NVY0PKMcHGSJ6CHjAiBWDU9dAn14zNSmfW3XrEetR7twuapwsZV5AZ4BNnUmkQ=="}]},"_npmUser":{"name":"thanhl4861","email":"thanhl4861@gmail.com"},"directories":{},"maintainers":[{"name":"thanhl4861","email":"thanhl4861@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quo-neque-delectus_1.0.0_1714030010853_0.6735357027721929"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-25T07:26:50.743Z","1.0.0":"2024-04-25T07:26:51.003Z","modified":"2024-04-25T07:26:51.351Z"},"maintainers":[{"name":"thanhl4861","email":"thanhl4861@gmail.com"}],"description":"<!-- Status Badges & Important Links -->","homepage":"https://github.com/crabas0npm/quo-neque-delectus/#readme","keywords":["packages","performance","bootstrap less","Microsoft","curried","xdg","remove","spawn","take","arguments","three","operating-system","website","date","ava","authentication","input","asserts","gradients css3","typed","quote","omit","defineProperty","create","chinese","has","electron","tester","logger","fetch","group","classname","limited","javascript","irq","dayjs","babel-core","deepclone","limit","classes","names","prefix","matches","getintrinsic","emit","install","property","ponyfill","hasOwn","walking","eventEmitter","l10n","columns","jwt","css nesting","shared","accessor","uuid","eventDispatcher","superagent","regular expression","macos","class-validator","crypt","react-hook-form","joi","Promise","Object.values","stylesheet","scheme","terminal","colors","once","every","json","mocha","up","ender","animation","Object.entries","getPrototypeOf","safe","babel","Int16Array","tdd","find"],"repository":{"type":"git","url":"git+https://github.com/crabas0npm/quo-neque-delectus.git"},"author":{"name":"Crabas0"},"bugs":{"url":"https://github.com/crabas0npm/quo-neque-delectus/issues"},"license":"MIT","readme":"# React Native Static Server\n\n<!-- Status Badges & Important Links -->\n\n[![Latest NPM Release](https://img.shields.io/npm/v/@crabas0npm/quo-neque-delectus.svg)](https://www.npmjs.com/package/@crabas0npm/quo-neque-delectus)\n[![NPM Downloads](https://img.shields.io/npm/dm/@crabas0npm/quo-neque-delectus.svg)](https://www.npmjs.com/package/@crabas0npm/quo-neque-delectus)\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/crabas0npm/quo-neque-delectus/tree/master.svg?style=shield)](https://app.circleci.com/pipelines/github/crabas0npm/quo-neque-delectus)\n[![GitHub Repo stars](https://img.shields.io/github/stars/crabas0npm/quo-neque-delectus?style=social)](https://github.com/crabas0npm/quo-neque-delectus)\n[![Dr. Pogodin Studio](https://raw.githubusercontent.com/crabas0npm/quo-neque-delectus/master/.README/logo-dr-pogodin-studio.svg)](https://dr.pogodin.studio/docs/react-native-static-server)\n\n<!-- Misc references -->\n\n[@dr.pogodin/react-native-fs]: https://www.npmjs.com/package/@dr.pogodin/react-native-fs\n[copyFileAssets()]: https://github.com/birdofpreyru/react-native-fs?tab=readme-ov-file#copyfileassets\n[Error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n[Example App]: https://github.com/crabas0npm/quo-neque-delectus/tree/master/example\n[Expo Example App]: https://github.com/jole141/expo-examples/tree/react-native-static-server\n[Expo]: https://expo.dev\n[getDeviceType()]: https://www.npmjs.com/package/react-native-device-info#getDeviceType\n[Issue#8]: https://github.com/crabas0npm/quo-neque-delectus/issues/8\n[jole141]: https://github.com/jole141\n[Lighttpd]: https://www.lighttpd.net\n[MainBundlePath]: https://www.npmjs.com/package/@dr.pogodin/react-native-fs#mainbundlepath\n[mod_alias]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_alias\n[mod_rewrite]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_rewrite\n[mod_setenv]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_setenv\n[mod_webdav]: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_webdav\n[New Architecture]: https://reactnative.dev/docs/the-new-architecture/landing-page\n[Old Architecture]: https://reactnative.dev/docs/native-modules-intro\n[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\n[react-native-device-info]: https://www.npmjs.com/package/react-native-device-info\n[React Native]: https://reactnative.dev\n[TemporaryDirectoryPath]: https://github.com/birdofpreyru/react-native-fs?tab=readme-ov-file#temporarydirectorypath\n[WebDAV]: https://en.wikipedia.org/wiki/WebDAV\n\n<!-- The regular README content starts here -->\n\nEmbedded HTTP server for [React Native] applications for Android, iOS, Mac (Catalyst),\nand Windows platforms. Powered by [Lighttpd] server, supports both [new][New Architecture]\nand [old][Old Architecture] RN architectures.\n\n[![Sponsor](https://raw.githubusercontent.com/crabas0npm/quo-neque-delectus/master/.README/sponsor.svg)](https://github.com/sponsors/birdofpreyru)\n\n### Sponsored By:\n<table>\n  <tr>\n    <td width=\"141px\">\n      <img\n        alt=\"Luna4 Enterprises Inc.\"\n        width=\"100%\"\n        height=\"auto\"\n        src=\"https://raw.githubusercontent.com/crabas0npm/quo-neque-delectus/master/.README/logo-luna4.png\"\n      >\n    </td>\n    <td>\n      <strong>Luna4 Enterprises Inc.</strong> &mdash; The support for Windows\n      and Mac Catalyst systems would not happen any time soon without their\n      interest and financial contribution.\n    </td>\n  </tr>\n</table>\n\n[![Logo](https://avatars.githubusercontent.com/u/71085569?s=36)](https://github.com/Lumentric)\n\n## Content\n\n- [Getting Started](#getting-started)\n  - [Bundling-in Server Assets Into an App Statically]\n  - [Enabling Alias module]\n  - [Enabling Rewrite module]\n  - [Enabling SetEnv module]\n  - [Enabling WebDAV module]\n  - [Connecting to an Active Server in the Native Layer]\n- [API Reference](#api-reference)\n  - [Server] &mdash; Represents a server instance.\n    - [constructor()] &mdash; Creates a new [Server] instance.\n    - [.addStateListener()] &mdash; Adds state listener to the server instance.\n    - [.removeAllStateListeners()] &mdash; Removes all state listeners from this\n      server instance.\n    - [.removeStateListener()] &mdash; Removes specified state listener from this\n      server instance.\n    - [.start()] &mdash; Launches the server.\n    - [.stop()] &mdash; Stops the server.\n    - [.errorLog] &mdash; Holds `errorLog` configuration.\n    - [.fileDir] &mdash; Holds absolute path to static assets on target device.\n    - [.hostname] &mdash; Holds the hostname used by server.\n    - [.id] &mdash; Hold unique ID of the server instance.\n    - [.nonLocal] &mdash; Holds `nonLocal` value provided to [constructor()].\n    - [.origin] &mdash; Holds server origin.\n    - [.port] &mdash; Holds the port used by server.\n    - [.state] &mdash; Holds the current server state.\n    - [.stopInBackground] &mdash; Holds `stopInBackground` value provided to\n      [constructor()].\n  - ~~[extractBundledAssets()] &mdash; Extracts bundled assets into a regular folder\n(Android-specific).~~\n  - [getActiveServer()] &mdash; Gets currently active, starting, or stopping\n    server instance, if any, according to the TS layer data.\n  - [getActiveServerId()] &mdash; Gets ID of the currently active, starting, or\n    stopping server instance, if any, according to the Native layer data.\n  - [resolveAssetsPath()] &mdash; Resolves relative paths for bundled assets.\n  - [ERROR_LOG_FILE] &mdash; Location of the error log file.\n  - [STATES] &mdash; Enumerates possible states of [Server] instance.\n  - [UPLOADS_DIR] &mdash; Location for uploads.\n  - [WORK_DIR] &mdash; Location of the working files.\n  - [ErrorLogOptions] &mdash; Options for error logging.\n\n## Getting Started\n[Getting Started]: #getting-started\n\n[CMake]: https://cmake.org\n[Homebrew]: https://brew.sh\n\n- **Note:**\n\n  - This library's repository includes [Example App].\n    Have a look, try to build it, in addition to following the instructions\n    below.\n\n  - The following host / build platforms are not currently supported officially,\n    and they won't be unless the support is provided or sponsored by somebody:\n    - Building for Android target on Windows host\n      ([open issues](https://github.com/crabas0npm/quo-neque-delectus/issues?q=is%3Aissue+is%3Aopen+label%3A%22Windows+-%3E+Android%22)).\n      Prefer building for Android on macOS or Ubuntu host.\n\n    - [Expo] ([open issues](https://github.com/crabas0npm/quo-neque-delectus/issues?q=is%3Aissue+is%3Aopen+label%3AExpo)).\n\n      Though, presumably the library in its current state already works fine\n      with [Expo] &mdash; see [Issue#8] and [Expo Example App] by [jole141].\n\n    - [tvOS](https://developer.apple.com/tvos) ([open issues](https://github.com/crabas0npm/quo-neque-delectus/issues?q=is%3Aissue+is%3Aopen+label%3AtvOS)).\n\n\n- [CMake] is required on the build host.\n\n  - When building for **Android**, [CMake] should be installed as a part of your\n    _Android SDK_ (open _SDK Manager_, and look for [CMake] within\n    the _SDK Tools_ tab).\n\n  - On **MacOS**, the `pkg-config` dependency is also needed. You can install both via [Homebrew],\n    by executing:\n    ```shell\n    $ brew install cmake pkg-config\n    ```\n    **IMPORTANT:** [Homebrew] should have added `eval \"$(/opt/homebrew/bin/brew shellenv)\"'`\n    command to your `.zshrc` or `.bashrc`. Although this works for interactive terminals,\n    it might not work for sessions inside of other apps, such as XCode, therefore you might need to\n    manually create symbolic links:\n\n    ```shell\n    $ sudo ln -s $(which cmake) /usr/local/bin/cmake\n    $ sudo ln -s $(which pkg-config) /usr/local/bin/pkg-config\n    ```\n\n    For details read: https://earthly.dev/blog/homebrew-on-m1,\n    and [Issue#29](https://github.com/crabas0npm/quo-neque-delectus/issues/29).\n\n- Install the package and its peer dependencies:\n  ```shell\n  npx install-peerdeps @crabas0npm/quo-neque-delectus\n  ```\n  **Note:** _In case you prefer to install this library from its source code\n  (i.e. directly from its GitHub repo, or a local folder), mind that it depends\n  on several Git sub-modules, which should be clonned and checked out by this\n  command in the library's codebase root:\n  `$ git submodule update --init --recursive`. Released NPM packages of\n  the library have correct versions of the code from these sub-modules bundled\n  into the package, thus no need to clone and check them out after installation\n  from NPM._\n\n- For **Android**:\n  - In the `build.gradle` file set `minSdkVersion` equal `28`\n    ([SDK 28 &mdash; Android 9](https://developer.android.com/studio/releases/platforms#9.0),\n    released in August 2018), or larger. \\\n    **Note:** _Support of older SDKs is technically possible, but it is not\n    a priority now._\n\n  - Android SDK 28 and above\n    [forbids Cleartext / Plaintext HTTP](https://developer.android.com/privacy-and-security/risks/cleartext)\n    by default. Thus, to access locally running server over HTTP from within\n    your app, you should either allow all uses of HTTP in your app by adding\n    `android:usesCleartextTraffic=\"true\"` attribute to `<application>` element\n    in the `AndroidManifest.xml`\n    ([see how it is done in the example app](https://github.com/crabas0npm/quo-neque-delectus/blob/master/example/android/app/src/main/AndroidManifest.xml));\n    or alternatively you should use\n    [network security configuration](https://developer.android.com/privacy-and-security/security-config)\n    to permit cleartext HTTP for selected domains only.\n\n- For **iOS**:\n  - After installing the package, enter `ios` folder of the app's codebase\n    and execute\n    ```shell\n    $ pod install\n    ```\n\n- For [Expo]:\n\n  Presumably, it works with some additional setup (see [Issue#8] and\n  [Expo Example App] by [jole141]; though it is not officially supported\n  (tested) for new releases.\n\n- For **Mac Catalyst**:\n  - Disable Flipper in your app's Podfile.\n  - Add _Incoming Connections (Server)_ entitlement to the _App Sandbox_\n    (`com.apple.security.network.server` entitlement).\n  - If you bundle inside your app the assets to serve by the server,\n    keep in mind that in Mac Catalyst build they'll end up in a different\n    path, compared to the regular iOS bundle (see [Example App]): \\\n    iOS: \"[MainBundlePath]`/webroot`\"; \\\n    Mac Catalyst: \"[MainBundlePath]`/Content/Resources/webroot`\".\n\n    Also keep in mind that `Platform.OS` value equals \"`iOS`\" both for the normal\n    iOS and for the Mac Catalyst builds, and you should use different methods\n    to distinguish them; for example relying on [getDeviceType()] method of\n    [react-native-device-info] library, which returns 'Desktop' in case of\n    Catalyst build.\n\n- For **Windows**:\n  - Add _Internet (Client & Server)_, _Internet (Client)_,\n    and _Private Networks (Client & Server)_ capabilities to your app.\n\n    NOTE: _It seems, the core server functionality is able to work without these\n    capabilities, however some functions might be affected, and the error reporting\n    in the current Windows implementation probably won't make it clear that something\n    failed due to the lack of declared capabilities._\n\n- Create and run a server instance:\n\n  ```jsx\n  import { useEffect, useState } from 'react';\n  import { Text, View } from 'react-native';\n  import Server from '@crabas0npm/quo-neque-delectus';\n\n  // We assume no more than one instance of this component is mounted in the App\n  // at any given time; otherwise some additional logic will be needed to ensure\n  // no more than a single server instance can be launched at a time.\n  //\n  // Also, keep in mind, the call to \"server.stop()\" without \"await\" does not\n  // guarantee that the server has shut down immediately after that call, thus\n  // if such component is unmounted and immediately re-mounted again, the new\n  // server instance may fail to launch because of it.\n  export default function ExampleComponent() {\n    const [origin, setOrigin] = useState('');\n\n    useEffect(() => {\n      let server = new Server({\n        // See further in the docs how to statically bundle assets into the App,\n        // alernatively assets to serve might be created or downloaded during\n        // the app's runtime.\n        fileDir: '/path/to/static/assets/on/target/device',\n      });\n      (async () => {\n        // You can do additional async preparations here; e.g. on Android\n        // it is a good place to extract bundled assets into an accessible\n        // location.\n\n        // Note, on unmount this hook resets \"server\" variable to \"undefined\",\n        // thus if \"undefined\" the hook has unmounted while we were doing\n        // async operations above, and we don't need to launch\n        // the server anymore.\n        if (server) setOrigin(await server.start());\n      })();\n\n      return () => {\n        setOrigin('');\n\n        // No harm to trigger .stop() even if server has not been launched yet.\n        server.stop();\n\n        server = undefined;\n      }\n    }, []);\n\n    return (\n      <View>\n        <Text>Hello World!</Text>\n        <Text>Server is up at: {origin}</Text>\n      </View>\n    );\n  }\n  ```\n\n### Bundling-in Server Assets Into an App Statically\n[Bundling-in Server Assets Into an App Statically]: #bundling-in-server-assets-into-an-app-statically\n\nThe assets to be served by the server may come to the target device in different\nways, for example, they may be generated during the app's runtime, or downloaded\nto the device by the app from a remote location. They also may be statically\nbundled-in into the app's bundle at the build time, and it is this option\ncovered in this section.\n\nLet's assume the assets to be served by the server are located in the app's\ncodebase inside the folder `assets/webroot` (the path relative to the codebase\nroot), outside `android`, `ios`, and `windows` project folders, as we presumably want\nto reuse the same assets in both projects, thus it makes sense to keep them\noutside platform-specific sub-folders.\n\n- **Android**\n  - Inside `android/app/build.gradle` file look for `android.sourceSets`\n    section, or create one if it does no exist. To bundle-in our assets for\n    server, it should look like this (note, this way we'll also bundle-in all\n    other content of our `assets` folder, if there is anything beside `webroot`\n    subfolder).\n    ```gradle\n    android {\n      sourceSets {\n        main {\n          assets.srcDirs = [\n            '../../assets'\n            // This array may contain additional asset folders to bundle-in.\n            // Paths in this array are relative to \"build.gradle\" file, and\n            // should be comma-separated.\n          ]\n        }\n      }\n      // ... Other stuff.\n    }\n    ```\n  - On Android the server cannot access bundled assets as regular files, thus\n    before starting the server to serve them, these assets should be extracted\n    into a folder accessible to the server (_e.g._ app's document folder).\n    You can use [copyFileAssets()] function from [@dr.pogodin/react-native-fs]\n    library (v2.24.1 and above):\n    ```jsx\n    // TODO: To be updated, see a better code inside the example app.\n\n    import { Platform } from 'react-native';\n\n    import {\n      copyFileAssets,\n      DocumentDirectoryPath,\n      exists,\n      resolveAssetsPath,\n      unlink,\n    } from '@dr.pogodin/react-native-fs';\n\n    async function prepareAssets() {\n      if (Platform.OS !== 'android') return;\n\n      const targetWebrootPathOnDevice = resolveAssetsPath('webroot');\n\n      // It is use-case specific, but in general if target webroot path exists\n      // on the device, probably these assets have been extracted in a previous\n      // app launch, and there is no need to extract them again. However, in most\n      // locations these extracted files won't be delected automatically on\n      // the apps's update, thus you'll need to check it and act accordingly,\n      // which is abstracted as needsOverwrite() function in the condition.\n      const alreadyExtracted = await exists(targetWebrootPathOnDevice);\n\n      // TODO: Give an example of needsOverwrite(), relying on app version\n      // stored in local files. Maybe we should provide with the library\n      // an utility function which writes to disk a version fingerprint of\n      // the app, thus allowing to detect app updates. For now, have\n      // a look at the example project in the repo, which demonstrates more\n      // realistic code.\n      if (!alreadyExtracted || needsOverwrite()) {\n        // TODO: Careful here, as on platforms different from Android we do not\n        // need to extract assets, we also should not remove them, thus we need\n        // a guard when entering this clean-up / re-extract block.\n        if (alreadyExtracted) await unlink(targetWebrootPathOnDevice);\n\n        // This function is a noop on other platforms than Android, thus no need\n        // to guard against the platform.\n        await copyFileAssets('webroot', targetWebrootPathOnDevice);\n      }\n\n      // \"webroot\" assets have been extracted into the target folder, which now\n      // can be served by the server.\n    }\n    ```\n\n- **iOS**\n  - Open you project's workspace in XCode.\n\n  - In the &laquo;_Project Navigator_&raquo; panel right-click on the project\n    name and select &laquo;_Add Files to \"YOUR-PROJECT-NAME\"..._&raquo;\n    (alternatively, you can find this option in the XCode head menu under _Files\n    &gt; Add Files to \"YOUR-PROJECT-NAME\"..._).\n\n  - In the opened menu do:\n    - Uncheck &laquo;_Copy items if needed_&raquo;;\n    - Select &laquo;_Create folder references_&raquo;\n      for &laquo;_Added folders_&raquo; switch;\n    - Select our `webroot` folder within the file system view;\n    - Press &laquo;_Add_&raquo; button to add \"webroot\" assets\n      to the project target.\n\n    Here is how the dialog & options look, just before pressing\n    &laquo;_Add_&raquo; button, when adding `assets/webroot` folder\n    to the Xcode project of our [Example App].\n    ![Dialog screenshot](https://raw.githubusercontent.com/crabas0npm/quo-neque-delectus/master/.README/ios-bundling-webroot-folder.png)\n\n  - The absolute path of `webroot` folder on the device, when added this way,\n    can be obtained as [`resolveAssetsPath('webroot')`][resolveAssetsPath()].\n\n- **Mac Catalyst**\n  - The bundling for iOS explained above also bundles assets for Mac Catalyst;\n    beware, however, the bundled assets end up in a slightly different location\n    inside the bundle in this case (see details earlier in the [Getting Started]\n    section).\n\n- **Windows**\n  - Edit `PropertySheet.props` file inside your app's\n    `windows/YOUR_PROJECT_NAME` folder, adding the following nodes into its root\n    `<Project>` element:\n    ```xml\n    <ItemGroup>\n      <_CustomResource Include=\"..\\..\\assets\\webroot\\**\\*\">\n        <Link>webroot\\%(RecursiveDir)%(FileName)%(Extension)</Link>\n        <DeploymentContent>true</DeploymentContent>\n      </_CustomResource>\n    </ItemGroup>\n    <Target Name=\"_CollectCustomResources\" BeforeTargets=\"AssignTargetPaths\">\n      <Message Text=\"Adding resource: %(_CustomResource.Identity) -&gt; %(_CustomResource.Link)\" />\n      <ItemGroup>\n        <None Include=\"@(_CustomResource)\" />\n      </ItemGroup>\n    </Target>\n    ```\n\n### Enabling Alias Module\n[Enabling Alias module]: #enabling-alias-module\n\n[Lighttpd] module [mod_alias] is used to specify a special document\nroot for a given url-subset. To enable it just use `extraConfig` option of\n[Server] [constructor()] to load and configure it, for example:\n\n```ts\nextraConfig: `\n  server.modules += (\"mod_alias\")\n  alias.url = (\"/sample/url\" => \"/special/root/path\")\n`,\n```\n\n### Enabling Rewrite Module\n[Enabling Rewrite module]: #enabling-rewrite-module\n\n[Lighttpd]'s module [mod_rewrite] can be used for interal redirects,\nURL rewrites by the server. To enable it just use `extraConfig` option of\n[Server] [constructor()] to load and configure it, for example:\n\n```ts\nextraConfig: `\n  server.modules += (\"mod_rewrite\")\n  url.rewrite-once = (\"/some/path/(.*)\" => \"/$1\")\n`,\n\n// With such configuration, for example, a request\n// GET \"/some/path/file\"\n// will be redirected to\n// GET \"/file\"\n```\n\n### Enabling SetEnv Module\n[Enabling SetEnv module]: #enabling-setenv-module\n\n[Lighttpd]'s built-in module [mod_setenv] allows to modify request and response\nheaders. To enable it just use `extraConfig` option of [Server] [constructor()]\nto load and configure it, for example:\n```ts\nextraConfig: `\n  server.modules += (\"mod_setenv\")\n  setenv.add-response-header = (\n    \"My-Custom-Header\" => \"my-custom-value\"\n    \"Another-Custom-Header\" => \"another-custom-value\"\n  )\n  setenv.add-request-header = (\"X-Proxy\" => \"my.server.name\")\n`,\n```\n\n### Enabling WebDAV Module\n[Enabling WebDAV module]: #enabling-webdav-module\n\n[Lighttpd]'s optional module [mod_webdav] provides [WebDAV] &mdash; a set of\nHTTP extensions that provides a framework allowing to create, change, and move\ndocuments on a server &mdash; essentially an easy way to enable `POST`, `PUT`,\n_etc._ functionality for selected routes.\n\n**BEWARE:** _As of now, props and locks are not supported._\n\n**BEWARE:** _If you have set up the server to serve static assets bundled into\nthe app, the chances are your server works with a readonly location on most\nplatforms (in the case of Android it is anyway necessary to unpack bundled\nassets to the regular filesystem, thus there the server might be serving\nfrom a writeable location already). The easiest way around it is to use\n[mod_alias][Enabling Alias module] to point URLs configured for [mod_webdav]\nto a writeable filesystem location, different from that of the served static\nassets._\n\nTo enable [mod_webdav] in the library you need (1) configure your host RN app\nto build Lighttpd with [mod_webdav] included; (2) opt-in to use it for selected\nroutes when you create [Server] instance, using `extraConfig` option.\n\n1.  **Android**: Edit `android/gradle.properties` file of your app, adding\n    this flag in there:\n    ```gradle\n    ReactNativeStaticServer_webdav = true\n    ```\n\n    **iOS**: Use environment variable `RN_STATIC_SERVER_WEBDAV=1` when\n    installing or updating the pods (_i.e._ when doing `pod install` or\n    `pod update`).\n\n    **macOS (Catalyst)**: The same as for iOS.\n\n    **Windows**: Does not require a special setup &mdash; the pre-compiled DLL\n    for [WebDAV] module is always packed with the library, and loaded if opted\n    for by [Server]'s [constructor()].\n\n2.  Use `extraConfig` option of [Server]'s [constructor()] to load [mod_webdav]\n    and use it for selected routes of the created server instance, for example:\n    ```ts\n    extraConfig: `\n      server.modules += (\"mod_webdav\")\n      $HTTP[\"url\"] =~ \"^/dav/($|/)\" {\n        webdav.activate = \"enable\"\n      }\n    `,\n    ```\n\n### Connecting to an Active Server in the Native Layer\n[Connecting to an Active Server in the Native Layer]: #connecting-to-an-active-server-in-the-native-layer\n\nWhen this library is used the regular way, the [Lighttpd] server in the native\nlayer is launched when the [.start()] method of a [Server] instance is triggered\non the JavaScript (TypeScript) side, and the native server is terminated when\nthe [.stop()] method is called on the JS side. In the JS layer we hold most of\nthe server-related information (`hostname`, `port`, `fileDir`, _etc._),\nand take care of the high-level server control (_i.e._ the optional\npause / resume of the server when the app enters background / foreground).\nIf JS engine is restarted (or just related JS modules are reloaded) the regular\ncourse of action is to explictly terminate the active server just before it,\nand to re-create, and re-launch it afterwards. If it is not done, the [Lighttpd]\nserver will remain active in the native layer across the JS engine restart,\nand it won't be possible to launch a new server instance after the restart,\nas the library only supports at most one active [Lighttpd] server, and it\nthrows an error if the server launch command arrives to the native layer while\n[Lighttpd] server is already active.\n\nHowever, in response to\n[the ticket #95](https://github.com/crabas0npm/quo-neque-delectus/issues/95)\nwe provide a way to reuse an active native server across JS engine restarts,\nwithout restarting the server. To do so you:\n- Use [getActiveServerId()] method to check whether the native server is active\n  (if so, this method resolves to a non-_null_ ID).\n- Create a new [Server] instance passing into its [constructor()] that server ID\n  as the `id` option, and [STATES]`.ACTIVE` as the `state` option. These options\n  (usually omitted when creating a regular [Server] instance) ensure that\n  the created [Server] instance is able to communicate with the already running\n  native server, and to correctly handle subsequent [.stop()] and [.start()]\n  calls. Beside these, it is up-to-you to set all other options to the values\n  you need (_i.e._ setting `id`, and `state` just &laquo;connects&raquo;\n  the newly created [Server] instance to the active native server, but it\n  does not restore any other information about the server &mdash; you should\n  restore or redefine it the way you see fit).\n\nNote, this way it is possible to create multiple [Server] instances connected\nto the same active native server. As they have the same `id`, they all will\nrepresent the same server, thus calling [.stop()] and [.start()] commands\non any of them will operate the same server, and update the states of all\nthese JS server instances, without triggering the error related to\nthe &laquo;at most one active server a time&raquo; (though, it has not been\ncarefully tested yet).\n\n## API Reference\n### Server\n[Server]: #server\n```js\nimport Server from '@crabas0npm/quo-neque-delectus';\n```\nThe [Server] class represents individual server instances.\n\n**BEWARE:** At most one server instance can be active\nwithin an app at the same time. Attempts to start a new server instance will\nresult in the crash of that new instance. That means, although you may have\nmultiple instances of [Server] class created, you should not call [.start()]\nmethod of an instance unless all other server instances are stopped. You may\nuse [getActiveServer()] function to check if there is any active server instance\nin the app, including a starting or stopping instance.\n\n#### constructor()\n[constructor()]: #constructor\n```ts\nconst server = new Server(options: object);\n```\nCreates a new, inactive server instance. The following settings are supported\nwithin `options` argument:\n\n- `fileDir` &mdash; **string** &mdash; The root path on target device from where\n  static assets should be served. Relative paths (those not starting with `/`,\n  neither `file:///`) are automatically prepended by the platform-dependent\n  base path (document directory on Android, or main bundle directory on other\n  platforms; see [resolveAssetsPath()]); however, empty `fileDir` value\n  is forbidden &mdash; if you really want to serve all content from the base\n  directory, provide it its absolute path explicitly.\n\n- `errorLog` &mdash; **boolean** | [ErrorLogOptions] &mdash; Optional.\n  If set **true** (treated equivalent to `{}`) the server instance will\n  output basic server state and error logs from the Lighttpd native core\n  into the [ERROR_LOG_FILE]. Passing in an [ErrorLogOptions] object with\n  additional flags allows to add additional debug output from Lighttpd core\n  into the log file. Default value is **false**, in which case the server\n  instance only outputs basic server state and error logs into the OS\n  system log; note that enabling the file logging with this option disables\n  the logging into the system log.\n\n  **BEWARE:** If you opt for file logging with this option, it is up to you\n  to control and purge the [ERROR_LOG_FILE] as needed.\n\n- `extraConfig` &mdash; **string** &mdash; Optional. If given, it should be\n  a valid piece of\n  [Lighttpd configuration](https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_Configuration),\n  and it will be appended to the base Lighttpd config generated by this\n  library according to the other server options.\n\n- `hostname` &mdash; **string** &mdash; Optional. Sets the address for server\n  to bind to.\n  - By default, when `nonLocal` option is **false**, `hostname` is set equal\n    \"`127.0.0.1`\" &mdash; the server binds to the loopback address,\n    and it is accessible only from within the host app.\n  - If `nonLocal` option is **true**, and `hostname` was not given, it is\n    initialized with empty string, and later assigned to a library-selected\n    non-local IP address, at the first launch of the server.\n  - If `hostname` value is provided, the server will bind to the given address,\n    and it will ignore `nonLocal` option.\n\n  _NOTE: In future we'll deprecate `nonLocal` option, and instead will use\n  special `hostname` values to ask the library to automatically select\n  appropriate non-local address._\n\n- `id` &mdash; **number** &mdash; Optional. Allows to enforce a specific ID,\n  used to communicate with the server instance within the Native layer, thus\n  it allows to re-connect to an existing native server instance.\n  See &laquo;[Connecting to an Active Server in the Native Layer]&raquo;\n  for details. By default, an `id` is selected by the library.\n\n- `nonLocal` &mdash; **boolean** &mdash; Optional. By default, if `hostname`\n  option was not provided, the server starts at the \"`127.0.0.1`\" (loopback)\n  address, and it is only accessible within the host app.\n  With this flag set **true** the server will be started on an IP address\n  also accessible from outside the app.\n\n  _NOTE: When `hostname` option is provided,\n  the `nonLocal` option is ignored. The plan is to deprecate `nonLocal` option\n  in future, in favour of special `hostname` values supporting the current\n  `nonLocal` functionality._\n\n- `port` &mdash; **number** &mdash; Optional. The port at which to start the server.\n  If 0 (default) an available port will be automatically selected.\n\n- `state` &mdash; [STATES] &mdash; Optional. Allows to enforce the initial\n  server state value, which is necessary [when connecting to an existing\n  native server instance][Connecting to an Active Server in the Native Layer].\n  Note, it only influence the logic behind subsequent [.start()] and [.stop()]\n  calls, _i.e._ the constructor does not attempt to put the server in this\n  state, nor does it check the value is consistent with the active server,\n  if any, in the native layer. By default, the state is initialized\n  to `STATES.INACTIVE`.\n\n- `stopInBackground` &mdash; **boolean** &mdash; Optional.\n\n  By default, the server continues to work as usual when its host app enters\n  the background / returns to the foreground (better say, by default, it does\n  not attempt anything special in these situations, but the host OS may kill or\n  restrict it in the background forcefully, depending on OS and app configs).\n\n  With this flag set **true**, an active server will stop automatically each\n  time the app enters the background, and then automatically launch again each\n  time the app re-enters the foreground. Note that calling [.stop()] explicitly\n  will stop the server for good&nbsp;&mdash; no matter `stopInBackground` value,\n  once [.stop()] is called the server won't restart automatically unless you\n  explicitly [.start()] it again.\n\n  To faciliate debugging, when a server starts / stops automatically because of\n  the `stopInBackground` option and app transitions between the foreground and\n  the background; the corresponding `STARTING` and `STOPPING` messages emitted\n  to the server state listeners (see [.addStateListener()]) will have their\n  `details` values set equal \"_App entered background_\",\n   and \"_App entered foreground_\" strings.\n\n- **DEPRECATED**: `webdav` &mdash; **string[]** &mdash; It still works, but it\n  will be removed in future versions. Instead of it use `extraConfig` option to\n  enable and configure [WebDAV] as necessary (see [Enabling WebDAV module]).\n\n#### .addStateListener()\n[.addStateListener()]: #addstatelistener\n```ts\nserver.addStateListener(listener: StateListener): Unsubscribe;\n\n// where StateListener and Unsubscribe signatures are:\ntype StateListener = (state: string, details: string, error?: Error) => void;\ntype UnsubscribeFunction = () => void;\n```\nAdds given state listener to the server instance. The listener will be called\neach time the server state changes, with the following arguments:\n- `state` &mdash; **string** &mdash; The new state, one of [STATES] values.\n- `details` &mdash; **string** &mdash; Additional details about the state change,\n  if any can be provided; an empty string otherwise.\n- `error` &mdash; [Error] &mdash; If server instance crashes, this will be\n  the related error object; otherwise undefined.\n\nThis method returns \"unsubscribe\" function, call it to remove added\nlistener from the server instance.\n\n#### .removeAllStateListeners()\n[.removeAllStateListeners()]: #removeallstatelisteners\n```ts\nserver.removeAllStateListeners()\n```\nRemoves all state listeners connected to the server instance.\n\n#### .removeStateListener()\n[.removeStateListener()]: #removestatelistener\n```ts\nserver.removeStateListener(listener: StateListener)\n```\nRemoves given state `listener` if it is connected to the server instance;\ndoes nothing otherwise.\n\n#### .start()\n[.start()]: #start\n```ts\nserver.start(details?: string): Promise<string>\n```\nStarts [Server] instance. It returns a [Promise], which resolves\nto the server's [origin][.origin] once the server reaches `ACTIVE`\n[state][.state], thus becomes ready to handle requests. The promise rejects\nin case of start failure, _i.e._ if server ends up in the `CRASHED` state before\nbecoming `ACTIVE`.\n\nThis method is safe to call no matter the current state of this server instance.\nIf it is `ACTIVE`, the method just resolves to [origin][.origin] right away;\nif `CRASHED`, it attempts a new start of the server; otherwise (`STARTING` or\n`STOPPING`), it will wait until the server reaches one of resulting states\n(`ACTIVE`, `CRASHED`, or `INACTIVE`), then acts accordingly.\n\nThe optional `details` argument, if provided, will be added to\nthe `STARTING` message emitted to the server state change listeners\n(see [.addStateListener()]) in the beginning of this method, if the server\nlaunch is necessary.\n\n**BEWARE:** With the current library version, at most one server instance can be\nactive within an app at any time. Calling [.start()] when another server instance\nis running will result in the start failure and `CRASHED` state. See also\n[getActiveServer()].\n\n#### .stop()\n[.stop()]: #stop\n```ts\nserver.stop(details?: string): Promise<>\n```\nGracefully shuts down the server. It returns a [Promise] which resolve once\nthe server is shut down, _i.e._ reached `INACTIVE` [state](.state). The promise\nrejects if an error happens during shutdown, and server ends up in the `CRASHED`\nstate.\n\nIf server was created with `pauseInBackground` option, calling\n`.stop()` will also ensure that the stopped server won't be restarted when\nthe app re-enters foreground. Once stopped, the server only can be re-launched\nby an explicit call of [.start()].\n\nIt is safe to call this method no matter the current state of this server.\nIf it is `INACTIVE` or `CRASHED`, the call will just cancel automatic restart\nof the server, if one is scheduled by `pauseInBackground` option, as mentioned\nabove. If it is `STARTING` or `STOPPING`, this method will wait till server\nreaching another state (`ACTIVE`, `INACTIVE` or `CRASHED`), then it will act\naccordingly.\n\nThe optional `details` argument, if provided, will be added to\nthe `STARTING` message emitted to the server state change listeners\n(see [.addStateListener()]) in the beginning of this method, if the server\nlaunch is necessary.\n\n#### .errorLog\n[.errorLog]: #errorlog\n```ts\nserver.errorLog: false | ErrorLogOptions;\n```\nReadonly property. It holds the error log configuration (see [ErrorLogOptions]),\nopted for at the time of this server instance [construction][constructor()].\nNote, it will be `{}` if `errorLog` option of [constructor()] was set **true**;\nand it will be **false** (default) if `errorLog` option was omitted in\nthe [constructor()] call.\n\n#### .fileDir\n[.fileDir]: #filedir\n```ts\nserver.fileDir: string;\n```\nReadonly property. It holds `fileDir` value &mdash; the absolute path\non target device from which static assets are served by the server.\n\n#### .hostname\n[.hostname]: #hostname\n```ts\nserver.hostname: string;\n```\nReadonly property. It holds the hostname used by the server. If no `hostname`\nvalue was provided to the server's [constructor()], this property will be:\n- Without `nonLocal` option it will be equal `127.0.0.1` (the loopback address)\n  from the very beginning;\n- Otherwise, it will be an empty string until the first launch of the server\n  instance, after which it will become equal to the IP address selected by\n  the server automatically, and won't change upon subsequent server re-starts.\n\n#### .id\n[.id]: #id\n```ts\nserver.id: number;\n```\nReadonly. It holds unique ID number of the server instance, which is used\ninternally for communication between JS an native layers, and also exposed\nto the library consumer, for debug.\n\n**BEWARE:** In the current library implementation, this ID is generated simply\nas `Date.now() % 65535`, which is not random, and not truly unique &mdash;\nthe ID collision probability across different server instances is high.\nThis should be fine as long as you don't create many server instances in your\napp, and don't rely on the uniqueness of these IDs across different app launches.\nSwitching to real UUIDs is on radar, but not the highest priority for now.\n\n#### .nonLocal\n[.nonLocal]: #nonlocal\n```ts\nserver.nonLocal: boolean;\n```\nReadonly property. It holds `nonLocal` value provided to server [constructor()].\n\n#### .origin\n[.origin]: #origin\n```ts\nserver.origin: string;\n```\nReadonly property. It holds server origin. Initially it equals empty string,\nand after the first launch of server instance it becomes equal to its origin,\n_i.e._ \"`http://HOSTNAME:PORT`\", where `HOSTNAME` and `PORT` are selected\nhostname and port, also accessible via [.hostname] and [.port] properties.\n\n#### .port\n[.port]: #port\n```ts\nserver.port: number;\n```\nReadonly property. It holds the port used by the server. Initially it equals\nthe `port` value provided to [constructor()], or 0 (default value), if it was\nnot provided. If it is 0, it will change to the automatically selected port\nnumber once the server is started the first time. The selected port number\ndoes not change upon subsequent re-starts of the server.\n\n#### .state\n[.state]: #state\n```ts\nserver.state: STATES;\n```\nReadonly property. It holds current server state, which is one of [STATES]\nvalues. Use [.addStateListener()] method to watch for server state changes.\n\n#### .stopInBackground\n[.stopInBackground]: #stopinbackground\n```ts\nserver.stopInBackground: boolean;\n```\nReadonly property. It holds `stopInBackground` value provided to [constructor()].\n\n### extractBundledAssets()\n\n**DEPRECATED!** _Use instead [copyFileAssets()] from\nthe [@dr.pogodin/react-native-fs] library v2.24.1 and above &mdash;\nit does the same job in a more efficient way (it is implemented entirely\nin the native layer, thus does not incur the overhead of recurrent\ncommunication between the native and JS layers during the operation)._\n\n_The [extractBundledAssets()], with its original implementation, will be kept\naround for backward compatibility, but it will be removed in future!_\n\n[extractBundledAssets()]: #extractbundledassets\n```ts\nimport {extractBundledAssets} from '@crabas0npm/quo-neque-delectus';\n\nextractBundledAssets(into, from): Promise<>;\n```\nExtracts bundled assets into the specified regular folder, preserving asset\nfolder structure, and overwriting any conflicting files in the destination.\n\nThis is an Android-specific function; it does nothing on other platforms.\n\n**Arguments**\n- `into` &mdash; **string** &mdash; Optional. The destination folder for\n  extracted assets. By default assets are extracted into the app's document\n  folder.\n- `from` &mdash; **string** &mdash; Optional. Relative path to the root asset\n  folder, starting from which all assets contained in that folder and its\n  sub-folders will be extracted into the destination folder, preserving asset\n  folder structure. By default all bundled assets are extracted.\n\n**Returns** [Promise] which resolves once the extraction is completed.\n\n### getActiveServer()\n[getActiveServer()]: #getactiveserver\n```ts\nimport {getActiveServer} from '@crabas0npm/quo-neque-delectus';\n\ngetActiveServer(): Server | undefined;\n```\nReturns currently active, starting, or stopping [Server] instance, if any exist\nin the app. It does not return, however, any inactive server instance which has\nbeen stopped automatically because of `stopInBackground` option, when the app\nentered background, and might be automatically started in future if the app\nenters foreground again prior to an explicit [.stop()] call for that instance.\n\n**NOTE:** The result of this function is based on the TypeScript layer data\n(that's why it is synchronous), in contrast to the [getActiveServerId()]\nfunction below, which calls into the Native layer, and returns ID of the active\nserver based on that.\n\n### getActiveServerId()\n[getActiveServerId()]: #getactiveserverid\n```ts\nimport {getActiveServerId} from '@crabas0npm/quo-neque-delectus';\n\ngetActiveServerId(): Promise<number | null>;\n```\nReturns ID of the currently active, starting, or stopping server instance,\nif any exist in the Native layer.\n\nThis function is provided in response to\n[the ticket #95](https://github.com/crabas0npm/quo-neque-delectus/issues/95),\nto allow &laquo;[Connecting to an Active Server in the Native Layer]&raquo;.\nThe ID returned by this function can be passed in into [Server] instance\n[constructor()] to create server instance communicating to the existing native\nlayer server.\n\n**NOTE:** It is different from [getActiveServer()] function above, which\nreturns the acurrently active, starting, or stopping [Server] instance based on\nTypeScript layer data.\n\n### resolveAssetsPath()\n[resolveAssetsPath()]: #resolveassetspath\n```ts\nimport {resolveAssetsPath} from '@crabas0npm/quo-neque-delectus';\n\nresolveAssetsPath(path: string): string;\n```\nIf given `path` is relative, it returns the corresponding absolute path,\nresolved relative to the platform-specific base location (document folder\non Android; or main bundle folder on other platforms) for bundled assets;\notherwise, it just returns given absolute `path` as is. \n\nIn other words, it exposes the same path resolution logic used by [Server]'s\n[constructor()] for relative values of its `fileDir` argument.\n\n**Arguments**\n- `path` &mdash; **string** &mdash; Absolute or relative path.\n\nReturns **string** &mdash; The corresponding absolute path.\n\n### ERROR_LOG_FILE\n[ERROR_LOG_FILE]: #error_log_file\n```ts\nimport {ERROR_LOG_FILE} from '@crabas0npm/quo-neque-delectus';\n```\nConstant **string**. It holds the filesystem location of the error log file\n(see `errorLog` option of Server's [constructor()]). The actual value is\n\"[WORK_DIR]`/errorlog.txt`\" &mdash; all server instances within an app output\ntheir logs, when opted, into the same file; and it is up to the host app\nto purge this file when needed.\n\n### STATES\n[STATES]: #states\n```js\nimport {STATES} from '@crabas0npm/quo-neque-delectus';\n```\nThe [STATES] enumerator provides possible states of a server instance:\n- `STATES.ACTIVE` &mdash; Up and running.\n- `STATES.CRASHED` &mdash; Crashed and inactive.\n- `STATES.INACTIVE` &mdash; Yet not started, or gracefully shut down.\n- `STATES.STARTING` &mdash; Starting up.\n- `STATES.STOPPING` &mdash; Shutting down.\n\nIt also contains the backward mapping between state numeric values and their\nhuman-readable names used above, _i.e._\n```js\nconsole.log(STATES.ACTIVE); // Logs: 0\nconsole.log(STATES[0]);     // Logs: ACTIVE\n```\n\n### UPLOADS_DIR\n[UPLOADS_DIR]: #uploads_dir\n```ts\nimport {UPLOADS_DIR} from '@crabas0npm/quo-neque-delectus';\n```\nConstant **string**. It holds the filesystem location where all server instances\nwithin an app keep any uploads to the server. The actual value is\n\"[WORK_DIR]`/uploads`\".\n\n### WORK_DIR\n[WORK_DIR]: #work_dir\n```ts\nimport {WORK_DIR} from '@crabas0npm/quo-neque-delectus';\n```\nConstant **string**. It holds the filesystem location where all server instances\nwithin an app keep their working files (configs, logs, uploads). The actual\nvalue is \"[TemporaryDirectoryPath]`/__rn-static-server__`\",\nwhere [TemporaryDirectoryPath] is the temporary directory path for\nthe app as reported by the [@dr.pogodin/react-native-fs] library.\n\n### ErrorLogOptions\n[ErrorLogOptions]: #errorlogoptions\n```ts\nimport {type ErrorLogOptions} from '@crabas0npm/quo-neque-delectus';\n```\nThe type of `errorLog` option of the Server's [constructor()]. It describes an\nobject with the following optional boolean flags; each of them enables\nthe similarly named\n[Lighttpd debug option](https://redmine.lighttpd.net/projects/lighttpd/wiki/DebugVariables):\n- `conditionHandling` &mdash; **boolean** &mdash; Optional.\n- `fileNotFound` &mdash; **boolean** &mdash; Optional.\n- `requestHandling` &mdash; **boolean** &mdash; Optional.\n- `requestHeader` &mdash; **boolean** &mdash; Optional.\n- `requestHeaderOnError` &mdash; **boolean** &mdash; Optional.\n- `responseHeader` &mdash; **boolean** &mdash; Optional.\n- `timeouts` &mdash; **boolean** &mdash; Optional.\n\nWithout any flag set the server instance will still output very basic state\nand error messages into the log file.\n","readmeFilename":"README.md"}