-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: added runmode for appserver.
- Loading branch information
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2023-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license. | ||
|
||
import * as appserver from "../appserver/mod.ts"; | ||
|
||
export class Lime extends appserver.AppServer { | ||
constructor() { | ||
super(); | ||
} | ||
|
||
// deno-lint-ignore no-explicit-any | ||
manifest(_manifest: any): Lime { | ||
return this; | ||
} | ||
|
||
// deno-lint-ignore no-explicit-any | ||
config(_config: any): Lime { | ||
return this; | ||
} | ||
|
||
dev(): Lime { | ||
return this; | ||
} | ||
|
||
start(): void { | ||
} | ||
} | ||
|
||
export function lime() { | ||
return new Lime(); | ||
} | ||
|
||
/* | ||
lime() | ||
.manifest(manifest) | ||
.config(config) | ||
.dev() // <!— dev mode | ||
.start(); | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
// Copyright 2023-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license. | ||
|
||
export * as functions from "./functions.ts"; | ||
export * as logging from "./logging.ts"; | ||
export * as patters from "./patterns.ts"; | ||
export * as promises from "./promises.ts"; | ||
export * as runModes from "./run-modes.ts"; | ||
export * as runtime from "./runtime.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2023-present Eser Ozvataf and other contributors. All rights reserved. Apache-2.0 license. | ||
|
||
export enum RunMode { | ||
Development = 0, | ||
Production = 1, | ||
Test = 2, | ||
} | ||
|
||
export function inDevelopmentMode(mode: RunMode): boolean { | ||
return (mode & RunMode.Production) !== RunMode.Production; | ||
} | ||
|
||
export function inProductionMode(mode: RunMode): boolean { | ||
return (mode & RunMode.Production) === RunMode.Production; | ||
} | ||
|
||
export function inTestMode(mode: RunMode): boolean { | ||
return (mode & RunMode.Test) === RunMode.Test; | ||
} |