Questions tagged [fastroute]

FastRoute is a library that provides a fast implementation of a regular expression based router in PHP

25 questions
4
votes
1 answer

nikic/FastRoute post request parameter access

I am trying to implement simple POST request using FastRoute. I sucefully implemented GET type request by following the given example. While implementing the POST request I am not able access the parameters that were send with request. $dispatcher =…
thinktwice
  • 131
  • 12
3
votes
2 answers

Is wrk benchmark tool reliable for testing fastest php framework

So I tried to test php framework on my localhost (6 year old i7 pc) using: wrk -t12 -c100 -d30s http://127.0.0.1 Laravel without DB I've got: 698 request per second Cakephp: 1,400 rps Swoole : 197,000 rps Swoole with middleware (fastroute, etc)…
John Laniba
  • 435
  • 3
  • 12
2
votes
1 answer

PHP - nikic/FastRoute routes for Middlewares\FastRoute package

I have got these route: ['GET', '/article/{id}', ['SuperBlog\Controller\ArticleController', 'show']], and I am using Middleware\FastRoute, Middle\RequestHandler and Relay packages to make a Request Handler. Also I am using php-di DI container. My…
2
votes
3 answers

How to get matched route name in View - Zend Expressive

I know that I can generate URL passing the route name url('route-name') #in view file ?> But can I get information in opposite direction? From current URL/URI, I need to get route name. Real case is: I have layout.phtml where…
tasmaniski
  • 4,767
  • 3
  • 33
  • 65
1
vote
1 answer

SlimPHP route with empty parameter fails

I have a route like this /product/update/{productId}/part/{partId} If I try to call that with one or more empty parameters, it fails and gives me a HTTP 404 Not Found, for example https://localhost/product/update//part/xyz123 I can't make them…
Magnus
  • 17,157
  • 19
  • 104
  • 189
1
vote
2 answers

Retrive DateTime from Neo4j using Lumen and NeoEloquent OGM

Context I'm creating an api rest that it interfaces to a graph db already filled by nodes and edge that describes events and exhibit's positions inside several museum that are charactirized by zones. In particular there are some edges between…
M.Morris
  • 147
  • 1
  • 12
1
vote
0 answers

Heroku: Only the "/" is working on my php app

I use php fast-route to handle routing on my application on Heroku free web dyno. The application is not using any framework. Only the / page works. The rest are not working. Though they work properly on my local server. If I try to access the login…
1
vote
1 answer

Retrieve edge and relationship properties using lumen

I'm new of lumen and neo4j, I'd like to add some properties to a specific relationship between two labels. For example if we suppose that there is a many to many relationship between the Exhibit label and Zone label that is characterized by…
M.Morris
  • 147
  • 1
  • 12
1
vote
1 answer

Create an api using lumen and neo4j

I want to create an api rest using lumen that it will comunicate with neo4j, for this purpose I'm using NeoEloquent. I've already read the NeoEloquent's documentation but I'm confused. I've understand how lumen it work with a relational database,…
M.Morris
  • 147
  • 1
  • 12
1
vote
1 answer

FastRoute: Pass route prefix to handler

For example, lets say I have this route. addRoute('GET', '/{slug}', ['App\Controllers\SomeController',…
chucky
  • 11
  • 2
1
vote
1 answer

What are these routing styles called in a web application?

What do you call routing that maps one URL directly to a file? Example: http://localhost/directory/file.php => /var/www/apache/htdocs/directory/file.php What do you call routing like one on…
Dennis
  • 7,907
  • 11
  • 65
  • 115
1
vote
0 answers

Route's base path for subdirectories

I have the following structure: /home/ alvaro/ public_html/ Code Playground/ SlimTest/ logs/ public/ src/ templates/ …
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
1
vote
1 answer

match http|https with fasteRoute in Slim3

here my sample FastRoute for slim3 : $app->get('/api/search/[{domaine}[/{notused:.+}]]', function ($request, $response, $args) { return $this->renderer->render($response, 'index.phtml', $args); }); with this FastRoute "regex"…
trucky
  • 11
  • 1
1
vote
0 answers

using Dice - Dependency Injector with Zend Diactoros and Fast Route

I'm using Dice(a nice Dependency Injector) for a small project. I am also using the PSR7 Zend Diactoros for requests and nikic fast route. I got Dice working for Twig, DB and all the rest of my classes using the examples from docs, but I am unable…
user2137406
  • 41
  • 1
  • 4
0
votes
1 answer

PHP Fastroute - Handle 404s

In my application I'm using FastRoute and I would like to have different types of 404 responses: When a call is made to a not existing endpoint starting with /api then the application should return a JSON 404 response. When a call is made to a not…
Dan
  • 3,329
  • 2
  • 21
  • 28
1
2