mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Seperate dbs
This commit is contained in:
@@ -17,14 +17,22 @@ import fs from 'fs'
|
||||
import logger from '../utils/logger'
|
||||
|
||||
interface URLFormatOptions {
|
||||
query: any
|
||||
pathname?: string
|
||||
query?: any
|
||||
}
|
||||
|
||||
// TODO
|
||||
function formatUrl(options: URLFormatOptions): string {
|
||||
console.log(options.pathname, options.query)
|
||||
return options.pathname + JSON.stringify(options.query)
|
||||
const queryString = options.query
|
||||
? '?' +
|
||||
Object.keys(options.query)
|
||||
.map((key) => {
|
||||
return `${key}=${encodeURIComponent(options.query[key])}`
|
||||
})
|
||||
.join('&')
|
||||
: ''
|
||||
const path = options.pathname || ''
|
||||
return path + queryString
|
||||
}
|
||||
|
||||
function GetDateString(noTime?: boolean): string {
|
||||
|
||||
Reference in New Issue
Block a user