Browse Source

Cleaning up unused files and comments

Herton 4 years ago
parent
commit
2166c22e49
4 changed files with 6 additions and 87 deletions
  1. 0 17
      Dockerfile
  2. 0 8
      composer.json
  3. 0 14
      docker-compose.yml
  4. 6 48
      readme.md

+ 0 - 17
Dockerfile

@@ -1,17 +0,0 @@
-FROM php:7.4-cli
-
-RUN apt-get update
-RUN apt-get install -y git libzip-dev zip
-
-RUN docker-php-ext-install zip
-
-# Get latest Composer
-COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
-
-COPY . /example
-WORKDIR /example
-
-# install the dependencies
-RUN composer install -o --prefer-dist
-
-CMD php -S localhost:8000 -t example

+ 0 - 8
composer.json

@@ -8,15 +8,7 @@
             "email": "hd@goodquestion.dev"
         }
     ],
-    "repositories": [
-        {
-            "type": "path",
-            "url": "./packages/goodquestiondev/simple-router-resource",
-            "symlink": true
-        }
-    ],
     "require": {
-        "goodquestiondev/simple-router-resource": "dev-master",
         "illuminate/support": "^8.7",
         "php": "^7.3",
         "symfony/http-foundation": "^5.1"

+ 0 - 14
docker-compose.yml

@@ -1,14 +0,0 @@
-version: "2"
-
-services:
-  web:
-    build: .
-    working_dir: ./
-    environment:
-      APP_ENV: local
-      XDEBUG_CONFIG: remote_enable=1
-      PHP_IDE_CONFIG: serverName=localhost
-    ports:
-      - 3000:8000
-    volumes:
-      - .:/app:rw

+ 6 - 48
readme.md

@@ -1,36 +1,6 @@
-### Wild Alaskan Company Routing Assignment
 
-You are familar with the Laravel router code no doubt. 
-What we want is to implement from scratch,
-a simplified version of Laravel's "resource router".
 
-https://laravel.com/docs/5.8/controllers#resource-controllers
-
-### Step 1
-Given a routes file say `routes.php`
-
-We want to be able to declare resources routes. 
-Resource routes will automatically pick up the `HTTP verb` from the web request
-and execute the corresponding functions in a controller that matches the route name.
-
-### Step 2 Detect and support HTTP verbs automatically
-For all supported `HTTP verbs`, implement the corresponding
-execution of the controller method.
-
-For example a verb of `GET` will execute the controller method `show`.
-Here is a table of the all the verbs we want to support.
-If a controller or method does not exist, then throw an exception.
-
-| Verb                   | Method  |
-|------------------------|---------|
-| get (with parameter)   | show    |
-| get /                  | index   |
-| post                   | store   |
-| put                    | update  |
-| delete                 | destroy |
-
-
-Here is an example of a `routes.php` file for a hypothetical blog application
+### Exmple Routes
 
 ```
 Route::resource('posts');
@@ -38,27 +8,15 @@ Route::resource('users.posts');
 Route::resource('categories.posts');
 ```
 
-For simplicity, the controller will have to be named based on the route parameter.
-So for the above example we expect these controllers. 
-
+### Exmple Controllers available
 
 ```
 PostsController.php
 UsersPostsController.php
 CategoriesPostsController.php
 ```
-We will not support custom controller names.
-
-Furthermore, the parameters in the route url should be passed to the controller methods.
-
-In the above example a url call of `GET /posts/123` should execute
-the method `show($id)` where `$id` is `123`
-
-Another example: a url call of `GET /users/bob/posts/999`
-should execute `show($name, $id)` where `$name` should evaluate to `bob` and `$id` should evaluate to `999`
-
-There is no need to handle any query strings or the actual request payload in a post or put. We only want to see the execution of the controller methods.
-
-Bonus: package into a standalone composer library
 
-Extra Bonus: Run this inside a docker container
+### To run the example:
+1. Pull the repository locally `https://git.hersidea.com/herton/wild-alaskan`
+2. Run `composer install`
+3. Run the server script `./serve.sh`