Skip to content
#

micro-framework

Here are 303 public repositories matching this topic...

ghost
ghost commented Sep 18, 2019

Issue Description

I updated echo in one of my projects. After that my static configuration didn't work without changes. Before it automatically resolved to an existing index.html. After that I had to point to that file.

My code was something like that:

docsGroup := e.Group("")
docsGroup.Static("/", "docs")

In docs is an index.html which was delivered when no path was given

igorsantos07
igorsantos07 commented Apr 15, 2020

Up to v3 there were a couple of easy ways to write out responses to a path:

  • simply return a string from the function: $app->get('/', fn() => 'hello world');
  • write to the response: $app->get('/', fn($req, $res) => $res->write('hello world'));
  • write JSON with $res->withJson() (this one is completely gone and we've got to default to json_encode() calls)

The first met

armeria
ikhoon
ikhoon commented Mar 19, 2020

In our codebase, we push RequestContext and immediately run some code with try-with-resources.
For example:

try (SafeCloseable ignored = ctx.push()) {
    logger.trace(decorate(msg));
}

If RequestContext provides run(Runnable) or call(Callable) we can reduce boilerplate code and simplify it.

ctx.run(() -> logger.trace(decorate(msg));

This is inspired by g

laravel-zero
stefkes
stefkes commented Mar 19, 2020

Installation of Laravel Zero with the command below

laravel-zero new TestApp

Results in output

Writing lock file
Generating optimized autoload files
> @php application app:rename
Renaming the application...

 What is your application name?:
 >

  Aborted.


Script @php application app:rename handling the post-create-project-cmd event returned with error code 1
Applicati
lemonbrain-mk
lemonbrain-mk commented Apr 19, 2020

Hey,

I did a lot of work for authorization for your project. The first one is to use your project with concrete5 and the second one is to authorize the requests with jwt including the websocket server. This would maybe be a good example package for your documentation, how somebody could include authorization? I know it's not an issue, but i dont know how to reach you :)
https://github.com/lemo

ktdreyer
ktdreyer commented Apr 11, 2019

I was writing my first app with Klein, and I wanted to serve some CSS and Javascript files. I read this example: https://klein.readthedocs.io/en/latest/examples/staticfiles.html

It shows me how to open up a directory, but anyone can browse the whole directory on disk to discover all the contents. I don't want to enable directory listings, and I just want to serve specific static files.

The [

trombik
trombik commented Aug 9, 2018

return_val is ignored when custom_fake is defined, but that fact is not well-documented.

suppose you are going to test set_pin_direction() function, which calls a fake function read8() that is supposed to read a value from an I2C slave. set_pin_direction() returns 0 when read8() has failed for whatever reason. you would like to test the function without slave IC.

first, fakeread8()

eddyyuen
eddyyuen commented Oct 25, 2019

代码设置 StaticResurceType:
g = new Gateway();
g.HttpOptions(options =>
{
options.StaticResurceType = "txt;xml;zip;jpg;css;png;htm;woff;svg;gif;woff2;js;html;jpeg;ico;rar";
}
g.Open();
woff 文件显示 403错误。
GET http://..../__system/layuiadmin/layui/font/iconfont.woff?v=230 net::ERR_ABORTED 403 (No permission)
如果使用 HttpConfig.json 则一切正常。

看了代码,只有在实例化HttpApiServer时才会初始化,后续设置StaticResurce

hexagon
jaguililla
jaguililla commented Feb 15, 2020

This task is going to be open until release 2.0.0, at that point a full review of all code base will be performed.

If you find some public element (class, method, field, etc.) without proper API documentation, feel free to make the PR and reference this issue. However, the issue won't be closed as stated before.

This will make users learn how to use this tool much faster.

Thank you for ma

Improve this page

Add a description, image, and links to the micro-framework topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the micro-framework topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.