The Protevus Platform: Unified Full-Stack Development https://protevus.com
Find a file
2018-07-12 16:29:16 -04:00
.idea Bump to 1.1.0 2017-12-21 01:37:03 -05:00
example 1.1.1 2018-07-12 15:58:30 -04:00
lib Added tests + bump version 2018-07-12 16:29:16 -04:00
test Added tests + bump version 2018-07-12 16:29:16 -04:00
.gitignore 1.1.1 2018-07-12 15:58:51 -04:00
.travis.yml Added tests + bump version 2018-07-12 16:29:16 -04:00
analysis_options.yaml 1.1.1 2018-07-12 15:58:30 -04:00
CHANGELOG.md Added tests + bump version 2018-07-12 16:29:16 -04:00
LICENSE Initial commit 2017-06-13 12:41:55 -04:00
pubspec.yaml Added tests + bump version 2018-07-12 16:29:16 -04:00
README.md Added tests + bump version 2018-07-12 16:29:16 -04:00

file_service

Pub build status

Angel service that persists data to a file on disk, stored as a JSON list. It uses a simple mutex to prevent race conditions, and caches contents in memory until changes are made.

The file will be created on read/write, if it does not already exist.

This package is useful in development, as it prevents you from having to install an external database to run your server.

When running a multi-threaded server, there is no guarantee that file operations will be mutually excluded. Thus, try to only use this one a single-threaded server if possible, or one with very low load.

While not necessarily slow, this package makes no promises about performance.

Usage

configureServer(Angel app) async {
  // Just like a normal service
  app.use(
    '/api/todos',
    new JsonFileService(
      const LocalFileSystem().file('todos_db.json')
    ),
  );
}