mirror of
https://github.com/seejohnrun/haste-server.git
synced 2026-02-10 16:01:32 +00:00
fix code, readme and lint
This commit is contained in:
@@ -12,7 +12,7 @@ class DocumentHandler {
|
||||
|
||||
maxLength?: number
|
||||
|
||||
public store: Store
|
||||
store: Store
|
||||
|
||||
keyGenerator: KeyGenerator
|
||||
|
||||
@@ -55,7 +55,7 @@ class DocumentHandler {
|
||||
)
|
||||
}
|
||||
|
||||
public handlePost(request: Request, response: Response) {
|
||||
handlePost(request: Request, response: Response) {
|
||||
// const this = this
|
||||
let buffer = ''
|
||||
let cancelled = false
|
||||
@@ -121,7 +121,7 @@ class DocumentHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public handleRawGet(request: Request, response: Response) {
|
||||
handleRawGet(request: Request, response: Response) {
|
||||
const key = request.params.id.split('.')[0]
|
||||
const skipExpire = !!this.config.documents[key]
|
||||
|
||||
|
||||
@@ -23,29 +23,29 @@ export type BaseStoreConfig = {
|
||||
|
||||
export interface MongoStoreConfig extends BaseStoreConfig {
|
||||
connectionUrl: string
|
||||
type: StoreNames.mongo
|
||||
type: StoreNames.Mongo
|
||||
}
|
||||
|
||||
export interface MemcachedStoreConfig extends BaseStoreConfig {
|
||||
host: string
|
||||
port: number
|
||||
type: StoreNames.memcached
|
||||
type: StoreNames.Memcached
|
||||
}
|
||||
|
||||
export interface FileStoreConfig extends BaseStoreConfig {
|
||||
path: string
|
||||
type: StoreNames.file
|
||||
type: StoreNames.File
|
||||
}
|
||||
|
||||
export interface AmazonStoreConfig extends BaseStoreConfig {
|
||||
bucket: string
|
||||
region: string
|
||||
type: StoreNames.amazons3
|
||||
type: StoreNames.AmazonS3
|
||||
}
|
||||
|
||||
export interface PostgresStoreConfig extends BaseStoreConfig {
|
||||
connectionUrl: string
|
||||
type: StoreNames.postgres
|
||||
type: StoreNames.Postgres
|
||||
}
|
||||
|
||||
export interface RethinkDbStoreConfig extends BaseStoreConfig {
|
||||
@@ -54,7 +54,7 @@ export interface RethinkDbStoreConfig extends BaseStoreConfig {
|
||||
db: string
|
||||
user: string
|
||||
password: string
|
||||
type: StoreNames.rethinkdb
|
||||
type: StoreNames.RethinkDb
|
||||
}
|
||||
|
||||
export interface RedisStoreConfig extends BaseStoreConfig {
|
||||
@@ -65,11 +65,11 @@ export interface RedisStoreConfig extends BaseStoreConfig {
|
||||
password?: string
|
||||
host?: string
|
||||
port?: string
|
||||
type: StoreNames.redis
|
||||
type: StoreNames.Redis
|
||||
}
|
||||
|
||||
export interface GoogleStoreConfig extends BaseStoreConfig {
|
||||
type: StoreNames.googledatastore
|
||||
type: StoreNames.GoogleDataStore
|
||||
}
|
||||
|
||||
export type StoreConfig =
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export enum StoreNames {
|
||||
amazons3 = 'amazon-s3',
|
||||
file = 'file',
|
||||
googledatastore = 'google-datastore',
|
||||
memcached = 'memcached',
|
||||
mongo = 'mongo',
|
||||
postgres = 'postgres',
|
||||
redis = 'redis',
|
||||
rethinkdb = 'rethinkdb'
|
||||
AmazonS3 = 'amazon-s3',
|
||||
File = 'file',
|
||||
GoogleDataStore = 'google-datastore',
|
||||
Memcached = 'memcached',
|
||||
Mongo = 'mongo',
|
||||
Postgres = 'postgres',
|
||||
Redis = 'redis',
|
||||
RethinkDb = 'rethinkdb'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user