caesar2011 / denotrain Goto Github PK
View Code? Open in Web Editor NEWWeb framework for Deno with often-used functions included
License: MIT License
Web framework for Deno with often-used functions included
License: MIT License
When I using path parameters from router with an int64 value, the automated parser return an incorrect value.
Eg: /:userId
--> /394518333870964737
Expect: { userId: 394518333870964737 }
Actual: { userId: 394518333870964740 }
I think you should add a new param like "options: object" to define more option (Eg: { parse: false }
to prevent automated parser).
error: TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname
~~~
at https://deno.land/x/[email protected]/path/win32.ts:911:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname;
~~~
at https://deno.land/x/[email protected]/path/posix.ts:433:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname
~~~
at https://deno.land/[email protected]/path/win32.ts:911:18
TS2345 [ERROR]: Argument of type 'string | URL' is not assignable to parameter of type 'string'.
Type 'URL' is not assignable to type 'string'.
return new URL(url).pathname;
~~~
at https://deno.land/[email protected]/path/posix.ts:433:18
Found 4 errors.
Trivial, but I was interested in reading the official site.
What I found
Url to official documentation site is broken.
What I expect
When I click the "View documentation on the Denotrain page [official documentation website](https://doc.deno.land/https/deno.land/x/denotrain@master/mod.ts)."
link located at https://github.com/Caesar2011/denotrain it should let see the official documentation website.
Reproduction
Click url as shown at bottom of page.
Pagic is a static site generator powered by Deno + React
Here are some demos:
Ask me anything if you have some problem.
This can be replaced by this:
const f = Deno.readTextFile(joinPath);
Originally posted by @lucacasonato in #16 (comment)
Hello!
I was wondering if it was possible to allow a handler to catch all requests for a certain path. For example, if we have
app.get("/:id/:thing", (ctx: ext.dt.Context) => {
// do whatever here
});
would it be possible for both /1/a
and /1/a/b
to be handled?
Hello Guys, nice work you all did !.
I have a question about the POST request:
here's my script
import { Application, Router } from "./deps.ts";
const app = new Application({ port: 3001 });
app.get("/", (ctx) => {
return { "hello": "world" };
});
app.post("/cadastrar", async (ctx) => {
console.log(ctx.req);
return ctx.req.body;
});
await app.run();
Postman
deno run --allow-net=0.0.0.0 https://deno.land/x/[email protected]/example/routers/example.ts
deno 1.7.0
error: Import 'https://deno.land/x/[email protected]/example/routers/example.ts' failed: 404 Not Found
The second example also not working
Get only typescript errors
I am trying to set a document root using following. For some reason, it's not working. Any idea if anything being done wrong here?
import {
Application,
Router,
} from "https://deno.land/x/[email protected]/mod.ts";
// Create a new application (port defualts to 3000, hostname to 0.0.0.0)
const app = new Application({
port: 80,
appRoot: "./site/",
// appRoot: "site/",
// appRoot: "site",
});
await app.run();
Denotrain is referenced by an example in Marcin Wosz's article "https://tsh.io/blog/deno-tutorial/" but running the application server results in the above SyntaxError. I upgraded to version 0.5.2 of denotrain but still get the error.
I have checked the code in this repo but cannot see anything obvious. I execute deno using deno run --allow-net
After testing around for a bit I have found that there exists a circular reference between the response and context classes. I was wondering if this is a critical issue or just the way it should be.
Hi, newbie here just wanted to ask if there is an easy way to stream audio to client?
Running the example script has this result:
Compile https://deno.land/x/[email protected]/mod.ts
error: Uncaught TypeError: Cannot resolve extension for "https://raw.githubusercontent.com/jshttp/mime-db/master/db.json" with mediaType "Json".
at getExtension ($deno$/compiler.ts:218:13)
at new SourceFile ($deno$/compiler.ts:263:22)
at Function.addToCache ($deno$/compiler.ts:339:16)
at processImports ($deno$/compiler.ts:743:31)
at async processImports ($deno$/compiler.ts:753:7)
at async processImports ($deno$/compiler.ts:753:7)
at async processImports ($deno$/compiler.ts:753:7)
at async processImports ($deno$/compiler.ts:753:7)
at async processImports ($deno$/compiler.ts:753:7)
at async compile ($deno$/compiler.ts:1316:31)
Initially ran it inside a ts file and so added any types. I tried running this as a js file as well.
Very unfamiliar with deno, sorry if this is a deno issue and not a denotrain issue.
EDIT: Running on WSL1
PS C:\Users\mark\Documents\PROJECTS\deno-test> deno --version
deno 1.0.0
v8 8.4.300
typescript 3.9.2
PS C:\Users\mark\Documents\PROJECTS\deno-test> deno run --allow-net=127.0.0.1 https://deno.land/x/[email protected]/example/routers/example.ts
Download https://deno.land/x/[email protected]/example/routers/example.ts
Compile https://deno.land/x/[email protected]/example/routers/example.ts
error: Uncaught PermissionDenied: network access to "0.0.0.0:3001", run again with the --allow-net flag
at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
at Object.sendSync ($deno$/ops/dispatch_json.ts:72:10)
at Object.listen ($deno$/ops/net.ts:51:10)
at listen ($deno$/net.ts:152:22)
at serve (https://deno.land/[email protected]/http/server.ts:261:20)
at Application.run (https://deno.land/x/[email protected]/Application.ts:29:15)
at https://deno.land/x/[email protected]/example/routers/example.ts:41:11
Routes created using a path template only allow for alphanumeric characters[1], which excludes many common values, such as kebab-case-slugs
, snake_case_slugs
, and ~user
directories.
I think this is a decent list of valid values, but given the pathname comes from URL you might be able to get away with just looking for anything that's not a path separator (e.g. /
).
new RegExp('[A-z0-9.\-_~!$&\'()*+,;=:@]+')
[3]
Another option would be to use pathToRegexp[2], which is what Express uses under the covers:
[1]
Line 209 in 7e18e2b
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.