Skip to content

Latest commit

 

History

History
62 lines (39 loc) · 1.65 KB

README.md

File metadata and controls

62 lines (39 loc) · 1.65 KB

[TS] MongoDB Cross Resource Database

Supported by CRC

This is a small resource that pulls in a library for database management that can be used in all resources.

It allows users to easily set and fetch data from any resource.

Usage

This resource handles the connection part, so skip that

See lib-cross-resource-cache for further usage.

Requires

Highly recommended to get the extension, for better event handling.

Installation

Inside of your main folder, you will need to install this library.

npm i @stuyk/cross-resource-cache
  • Create a folder in your src folder called crc-db.

  • Add the TypeScript files from this resource, to that folder.

You can also git clone directly into your src folder.

Setup

Modify server.toml and ensure it loads whatever you named the folder.

In the case of the example above it should be crc-db.

resources = [ 
    'mods-before-db',
    'crc-db',
    'resources-after-db',
    'dbg_reconnect'
]

Configuration

You need to modify the connectionString in the resource to point towards the right URL.

Open src/server/index.ts and modify the connectionString variable.

By default it uses localhost.