sotos.gr sotiris pezouvanis

Pezouvanis Sotiris

I am an electronics technician by profession, with an in-depth knowledge of code writing and its innovative use in Web and App Development.

Date : 29/01/2015
angular-slim-redbean-quick-mysql

Demo mysql data with angular
api RESTful service created with Slim and RedBeanPHP

is for test for localhost :P the app create automatic tables in mysql database

fields in the tables create automatic by selecting type of input in new entry

create new table navigate to localhost:8000/#!/{yourtablename}

RESTful service

Install the Slim http://www.slimframework.com/

Download the RedBeanPHP copy in to folder of your api.

with slim and the api/index.php of files. apiurl like http://localhost/api/ or http://localhost/my_api/api/.

create database in your mysql.

edit the index.php and fix the mysql connection.

//setup the REDBEANPHP
R::setup('mysql:host=localhost;dbname=yourdatabase','username','password');

after if you navigate to your localhost/api get array of tables of your database.

Instructions

app create with lineman and angular

for my api Slim enable the config/application.js API Proxying

server: { apiProxy: { prefix:'/my_api/', enabled: true, host: 'localhost', port: 80 } }

and set the dataService path in file services.js

return $resource('my_api/api/:data/:id', {}, {});

and set the path in file rootCtrl.js

$http.get('/my_api/api').success(function(data){

install

  1. git clone https://github.com/sotospez/angular-slim-redbean-quick-mysql.git my-app
  2. cd my-app
  3. sudo npm install -g lineman
  4. npm install
  5. open your web browser to localhost:8000

Demo
comments powered by Disqus