Update index
This commit is contained in:
12
core/database.py
Normal file
12
core/database.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from pymongo import MongoClient
|
||||
from PyJS import JSON
|
||||
from PyJS.modules import fs
|
||||
|
||||
col = MongoClient(JSON.parse(fs.createReadStream('settings.json'))['mongo'])['BytesBump']['servers']
|
||||
|
||||
class Servers:
|
||||
def get_all(**checks):
|
||||
return [server for server in col.find(checks)]
|
||||
|
||||
def get_one(**checks):
|
||||
return col.find_one(checks)
|
||||
5
core/routes.py
Normal file
5
core/routes.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from PyJS import JSON
|
||||
from PyJS.modules import fs
|
||||
|
||||
def route_for(route):
|
||||
return JSON.parse(fs.createReadStream('data/routes.json'))[route]
|
||||
Reference in New Issue
Block a user