1.2.2 • Published 1 year ago

ggs-database v1.2.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

GGS Database

GGS Database (https://github.com/garnik93/ggs.git).

Installation

$ npm install ggs-database

Example:

Create client:

const client = new GGSClient({
  store: {
      username: 'Username',
      password: 'Password',
      projectName: 'Your project name', 
      secreteKey: 'Your secrete key',
      host: 'localhost' || '12.34.02.100',
      port: 2456 || 'default' 3000
  }
})

Write data in db:

const collection = 'Your collection name'

const your_data = {
    name: 'Alina',
    age: 23,
    sex: 'Famele',
    country: 'Ukraine'
}

client.set(collection, your_data)

Read data in db:

const collection = 'Your collection name'

client.get(collection).then((data) => {
  console.log(data)
})

Destroy data in db:

const collection = 'Your collection name'

client.set(collection, {})

API

Methods:

Create method:

fetch(`http://${host}:${port}/api/${collection}`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${Your token}`,
    'Project-Name': `${Project name}`
  },
  body: JSON.stringify(Your object),
})

Get data method:

fetch(`http://${host}:${port}/api/${collection}`, {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${Your token}`,
    'Project-Name': `${Project name}`
  }
})
1.2.0

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago