vesparny / silex-simple-rest Goto Github PK
View Code? Open in Web Editor NEWA simple silex skeleton for writing scalable rest api
License: MIT License
A simple silex skeleton for writing scalable rest api
License: MIT License
It would be great if you could add some basic validations to the base project.
I'm new on sylex (indeed, I started after seeing this base project) and I'm not sure where I should include validation, if in the controller, service, or elsewhere
Thanks
How would you handle REST Authentication on your app?
And would you create a test for each service? What about end to end Testing?
Great work you have there.
Thank you
I think it would be nice to incorporate patterns for pagination. It is a must on every API.
how handle request parameters ?
One solution is to register SessionServiceProvider
$app->register(new Silex\Provider\SessionServiceProvider());
How to implement after method with particular routes
Ex. $api->post('/notes', "notes.controller:save"); //src/App/RoutesLoader.php
Everything about this code seems perfect, except that the app.db
is located in the root folder of the project. I was wondering if it's more appropriate and cleaner to put it in the storage folder instead, i.e. /storage/app.db
. It's only one path change in app.php
, where DoctrineServiceProvider()
is registered.
Hallo!
I wanna try to implement SessionServiceProvider (https://silex.symfony.com/doc/2.0/providers/session.html)
But I have problems at the moment of use $app['session'], beacuse $app it's not part of the controller endpoints, called from RoutesLoader.php.
Example: https://silex.symfony.com/doc/2.0/providers/session.html#usage
Some idea how I can implement this? Thanks. Regards.
Its stongly recommended do not show stack trace to the everyone API user. You should show this info only if debug mode is enabled, otherwise don't show it.
For example:
$data = [
'statusCode' => $code,
'message' => $e->getMessage(),
];
if ($app['debug']) {
$data['stacktrace'] = $e->getTraceAsString();
}
return new JsonResponse($data);
In most REST api for UPDATE use PUT why here is POST?
I look at that the version of the API is fixed in the code, but if I want to have more that one version how can I do ?
It would be great if you could include in the project some kind of fixture load mechanism for test cases purpose..
Thanks
You should remove angular js references in project (like in .htaccess or phpunit XML) and replace them for some placeholders, and remember the public to replace them in the readme.md
Thanks
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.