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:
parent
728931d56e
commit
4e34267d44
9 changed files with 149 additions and 82 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue