Skip to content

jmrhib/satellizer-slim-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example php-backend for Satellizer using Slim Framework

It is a work in progress, and currently only supports Twitter and Facebook.

Installation

  1. Import users.sql in a database.
  2. Open src/Config.php and edit settings for server, user, password, database.
  3. Copy all files except users.sql to server.
  4. Run composer install on the server you copied the files to.
  5. Edit .htaccess file to suit your needs.

On installations on the root path, it should look something like this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

If you are installing to a sub directory (for example, /api), it should look something like this:

RewriteEngine On
RewriteBase /api
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

Protecting routes

Use the file auth_filters.php to add routes you wish to require authentification for. For example, if you add a 'save' option in Slim like this:

$app->post('/save', function(){ /* Save user's data */ });

You would add this in auth_filters.php:

if (strpos($app->request()->getPathInfo(), "/save") === 0) {
    $auth_needed = true;
}

About

Example php-backend for Satellizer using Slim Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages