-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:
HTSXUtils
, errors handler, all http methods
- Loading branch information
Showing
8 changed files
with
291 additions
and
97 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,5 +1,5 @@ | ||
import HTSX, { HTSXProps, HTSXView, HTSXApi } from './main.ts' | ||
import HTSX, { HTSXProps, HTSXView, HTSXApi, HTSXUtils } from './main.ts' | ||
|
||
export { | ||
HTSX, type HTSXView, type HTSXApi, type HTSXProps | ||
HTSX, HTSXUtils, type HTSXView, type HTSXApi, type HTSXProps | ||
} |
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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import { HTSX } from './mod.ts' | ||
import { Application, Context } from 'https://deno.land/x/[email protected]/mod.ts' | ||
import { Application } from 'https://deno.land/x/[email protected]/mod.ts' | ||
import { Router } from 'https://deno.land/x/[email protected]/router.ts' | ||
|
||
const app = new Application() | ||
const router = new Router() | ||
|
||
await new HTSX({ | ||
root: './web', | ||
server: { app, router, init: () => { app.listen({ port: 8080 })} }, | ||
server: { app, router, init: () => { app.listen({ port: 8080 }); console.log('Server listening on 8080') } }, | ||
logger: (ctx) => { | ||
console.log(`New ${ctx.request.method} request! ${ctx.request.url} ${ctx.response.status === 200 ? `` : `, error: ${ctx.response.status}`}`) | ||
}, | ||
props: { | ||
payload: () => { | ||
payload: async (ctx) => { | ||
return { user: "John" } | ||
} | ||
} | ||
}) | ||
}) | ||
|
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 +0,0 @@ | ||
Other HTTP verbs for api endpoints | ||
+root.css | ||
utils for convinient work with arrays, awaits and more (each, await, etc...) | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.