curtcox-sourceongithubexample.web.val.run
Readme

Example showing how to reference source in public github repos.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Hono } from "https://deno.land/x/hono@v4.2.9/mod.ts";
import {
exported_function,
exported_function_with_parameters,
exported_number,
exported_string_constant,
ExportedClass,
} from "https://raw.githubusercontent.com/curtcox/TypescriptSamples/main/ts/SampleExports.ts";
const app = new Hono();
app.get("/", (c) => {
return c.html(`
<table border>
<tr> <th>thing </th> <th>example </th> </tr>
<tr> <th>number </th> <td>${exported_number} </td> </tr>
<tr> <th>string </th> <td>${exported_string_constant}</td> </tr>
<tr> <th>function </th> <td>${exported_function()} </td> </tr>
<tr> <th>with params</th> <td>${exported_function_with_parameters(6, 7)}</td></tr>
<tr> <th>class </th> <td>${new ExportedClass()} </td></tr>
</table>
<p>
<a href="https://github.com/curtcox/TypescriptSamples/blob/main/main.ts">Source for this page.</a>
<p>
<a href="https://raw.githubusercontent.com/curtcox/TypescriptSamples/main/ts/SampleExports.ts">URL used in import.</a>
`);
});
export default app.fetch;
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
July 25, 2024