-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
35 lines (24 loc) · 859 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require 'vendor/autoload.php';
//add custom app-controllers
require 'controllers/appcontroller.php';
//create slim-app
$app = new \Slim\Slim();
//set config params
$app->config('mode', 'development');
$app->config('debug', 'true');
// $app->config('templates.path', './client/dist'); // set template path to './client/dist' for yeoman-generated clients
$app->config('templates.path', './views'); // traditional views dir
//set up routes
$app->get('/', 'AppController:showAppView');
$app->get('/index.html', 'AppController:showAppView');
$app->get('/robots.txt', 'AppController:showRobotsFile');
$app->notFound(function () use ($app)
{
$app->render('404.html');
});
//use AppController
$app->get('/hello/', '\AppController:jump');
//use AppController with params
//$app->get('/hello/:name/:name2', '\TestController:sayHello');
$app->run();