-
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.
- Loading branch information
1 parent
0965508
commit e837ab0
Showing
7 changed files
with
56 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// deno-lint-ignore-file | ||
|
||
/** | ||
* @param url ex: <https://deno.land/x/[email protected]/lib/fart.ts> | ||
* @returns raw HTML generated from [`deno doc`](https://deno.land/[email protected]/tools/documentation_generator) | ||
* @todo @ethanthatonekid mirror https://doc.deno.land/https/deno.land%2Fx%2Ffart%40v0.1%2Flib%2Ffart.ts | ||
* @todo @ethanthatonekid serve any static files | ||
* @todo @ethanthatonekid remove deno-lint-ignore-file | ||
*/ | ||
export const fetchDenoDoc = async (url: string): Promise<string> => { | ||
return ""; | ||
}; |
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,10 @@ | ||
// deno-lint-ignore-file | ||
|
||
/** | ||
* @param url ex: <https://etok.codes/fart/blob/main/docs/pokemon-example.md> | ||
* @returns raw HTML of parsed documentation found on <https://etok.codes/fart/> | ||
* @todo @ethanthatonekid refactor https://github.com/EthanThatOneKid/fart/blob/c43f2333458b2cbc40d167610d87e2a2e3f89885/std/server/middleware/gh_docs.ts | ||
*/ | ||
export const fetchGitHubDoc = async (url: string): Promise<string> => { | ||
return ""; | ||
}; |
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,2 @@ | ||
export { fetchGitHubDoc } from "./gh_doc.ts"; | ||
export { fetchDenoDoc } from "./deno_doc.ts"; |
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,2 +1,15 @@ | ||
// deno-lint-ignore-file | ||
|
||
import { | ||
fetchDenoDoc, | ||
fetchGitHubDoc, | ||
} from "./bonus_features/doc_generator/mod.ts"; | ||
|
||
/** | ||
* This function handles any request sent to the Fart server. This includes | ||
* custom routing, and more. | ||
* @todo @ethanthatonekid fledge out the rest of the features | ||
*/ | ||
export const handleRequest = async (request: Request): Promise<Response> => { | ||
return Response.redirect("/"); | ||
}; |
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,13 @@ | ||
// deno-lint-ignore-file | ||
|
||
/** | ||
* Routes a given HTTP request to the intended `bonus_features` and | ||
* sets the appropriate content type header. | ||
* @param request incoming http request | ||
* @returns routed Fart server response | ||
*/ | ||
export const route = async (request: Request): Promise<Response> => { | ||
// TODO(@ethanthatonekid): double-check proper index checking | ||
const isIndex = request.url.length === 0 || request.url === "/"; | ||
return Response.redirect("/"); | ||
}; |
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,6 @@ | ||
import { handleRequest } from "./handle_request.ts"; | ||
|
||
addEventListener("fetch", async (event) => { | ||
const response = await handleRequest(event.request); | ||
event.respondWith(response); | ||
}); |
e837ab0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to deploy: