summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiel Schuurmans <michielschuurmans@gmail.com>2020-10-26 20:08:25 +0100
committerMichiel Schuurmans <michielschuurmans@gmail.com>2020-10-26 20:08:25 +0100
commit612534e0d0a7ce12bf08d03c395cb55ea95bfe9f (patch)
tree56072bdb1de133ee4cb788ba146bf4be0f448675
parent080774a0fa5270a0534bf2c27770bf62fa4074be (diff)
API: get one
Signed-off-by: Michiel Schuurmans <michielschuurmans@gmail.com>
-rw-r--r--api/.gitignore81
-rw-r--r--api/app/Http/Controllers/BlenderController.php5
-rw-r--r--api/routes/web.php1
3 files changed, 87 insertions, 0 deletions
diff --git a/api/.gitignore b/api/.gitignore
new file mode 100644
index 0000000..d0acf33
--- /dev/null
+++ b/api/.gitignore
@@ -0,0 +1,81 @@
+# ignore log files and databases
+*.log
+*.sql
+*.sqlite# ignore compiled files
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so# ignore packaged files
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip# ignore OS generated files
+ehthumbs.db
+Thumbs.db
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes# ignore Editor files
+*.sublime-project
+*.sublime-workspace
+*.komodoproject
+_ide_helper.php
+/.idea
+/.vscode
+# Eclipse project files
+.buildpath
+.project
+.settings/# Ignore cache
+.cache/# Ignore user created files :)
+*.bak
+*.orig# Ignore system files
+.bash_history
+LICENSE_AFL.txt
+LICENSE.html
+LICENSE.txt
+LICENSE_EE*
+RELEASE_NOTES.txt
+.ssh/
+error_log
+.htpasswds
+/.htaccess
+php.ini.sample
+.modgit/
+_vti_bin/
+_vti_cnf/
+_vti_inf.html
+_vti_log/
+_vti_pvt/
+_vti_txt/
+tmp/
+php.ini
+_old/
+.htpasswds/
+.htpasswd
+.viminfo
+.profile
+.bashrc
+.bash_logout
+.bash_history
+.modgit/
+.modman/
+pkginfo
+nohup.out
+Homestead.yaml
+Homestead.json
+/.vagrant
+.phpunit.result.cache#Laravel Specific files
+/vendor
+.env
+/public/.htaccess
+/storage
+storage/*.key
+
+*.sw*
diff --git a/api/app/Http/Controllers/BlenderController.php b/api/app/Http/Controllers/BlenderController.php
index cbba079..8c7924c 100644
--- a/api/app/Http/Controllers/BlenderController.php
+++ b/api/app/Http/Controllers/BlenderController.php
@@ -14,6 +14,11 @@ class BlenderController extends Controller
return response()->json(Blender::all());
}
+ public function get_one($id)
+ {
+ return response()->json(Blender::find($id));
+ }
+
public function create(Request $request)
{
$this->validate($request, [
diff --git a/api/routes/web.php b/api/routes/web.php
index 14b6975..aab65c1 100644
--- a/api/routes/web.php
+++ b/api/routes/web.php
@@ -20,6 +20,7 @@ $router->get('/', function () use ($router) {
$router->group(['prefix' => 'api/v1/blenders'], function () use ($router) {
$router->get('', ['uses' => 'BlenderController@get_all']);
+ $router->get('{id}', ['uses' => 'BlenderController@get_one']);
$router->post('', ['uses' => 'BlenderController@create']);
$router->post('{id}/start', ['uses' => 'BlenderController@start']);
$router->post('{id}/stop', ['uses' => 'BlenderController@stop']);