Giter Site home page Giter Site logo

davellanedam / phalcon-micro-rest-api-skeleton Goto Github PK

View Code? Open in Web Editor NEW
56.0 13.0 21.0 103 KB

This is a basic API REST skeleton written on Phalcon PHP. Great For building an MVP for your frontend app (Vue, react, angular, or anything that can consume an API)

License: MIT License

PHP 89.92% Shell 1.02% HTML 2.40% TSQL 6.67%
phalcon phalcon-micro-api postman skeleton php api micro rest-api rest token

phalcon-micro-rest-api-skeleton's People

Contributors

davellanedam avatar jeijei4 avatar l0wskilled avatar titonobre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phalcon-micro-rest-api-skeleton's Issues

Using this skeleton with Phalcon 4

Hi,

I am unable to get this skeleton to work with Phalcon 4.1.0 on my 64bit Windows 10 machine using Wampserver. It shows me errors in most initialization files as given below:

  • In config\services.php it says Undefined Phalcon\Di\FactoryDefault()
    $di = new FactoryDefault();

  • In config\acl.php it says Undefined Phalcon\Acl
    $acl->setDefaultAction(Phalcon\Acl::DENY);

  • In public\index.php
    $app = new Micro($di);

Do I have to run composer to complete the installation? Do I need to update the composer.json file for newer versions of Phalcon. I assume I will to update it. What do I specify in the dependencies?
composer update gives below errors on command prompt:

  Problem 1
    - phalcon/devtools[v3.2.0, ..., v3.2.13] require ext-phalcon ~3.1 -> it has the wrong version installed (4.1.0).
    - phalcon/devtools[v3.4.0, ..., v3.4.14] require ext-phalcon ~3.3 -> it has the wrong version installed (4.1.0).
    - Root composer.json requires phalcon/devtools ^3.2 -> satisfiable by phalcon/devtools[v3.2.0, ..., v3.4.14].

Phalcon 4.1.0. is installed and shown by phpinfo(). I am using Php 7.4.26 and Apache 2.4.51.
TIA.

Regards
Amal

Logging in & getting authentication token

Hi,

I am stuck at the first step. I have setup the environment with Wamp but I am unable to login. Pardon my lack of knowledge. I read most of the code in app.php, how to setup routes and acl etc. I then went deeper and read a few articles and tutorials about JWT on internet. I have never used it. How do I send my User/Password to the API. Earlier I had created a small REST API using node.js using a tutorial where we sent the credentials in a json object. I assume that will not work here.

I also understand that after authentication in Response object I will get the token which I have to use for all further calls. Second question, whose solution is most probably related to the first one, how will I send this token with each API call. I do see the config file server.development.php having space for the token and a key.

Amal

Unable to setup this skeleton

Hi,

I am using Wamp on Windows 7, 64bit. I setup the whole project by downloading zip file and setting it up. Ran Composer. I setup the database connection details in server.development.php. The setting
SetEnv APPLICATION_ENV "development" doesn't work in Windows so I have setup a Environment variable for the same.

I haven't modified app.php. I am just trying to get it the basic website going so that I can do more. It keeps giving 500 "Internal Server Error". I have modified the .htaccess and cleaned it, just leaving basic commands but still this error doesn't go away. There is nothing in Apache or PHP error logs.

Do I need to setup some of the Postman configuration. I have no knowledge of that. I did have a look at that file. I haven't touched the ACL files also.
I just want to first see index.phmtl to know everything is working fine. Then I will go to next step. I am working on REST API for the first time so kindly pardon my ignorance.

Amal

help setting it up... 500/404 errors

Hi, i'm using nginx - i first had the root pointed to /public folder and got 500 error while accessing via postman or compose test.
I changed it to root of application and now i'm gettign 404. When i visit the page https://api.mydomain.com - i get an error on page mod_rewrite need to be enabled... I do have equavelent mod_rewrite block in ngixn i believe like below

try_files $uri $uri/ @rewrite;

location @rewrite {
    rewrite ^/(.*)$ /index.php?_url=/$1;
}

on the environment config file i've not made any change except DB values, i've left the default values ( how do i generate keys?) 'authentication' => [
'secret' => 'your secret key to SIGN token', // This will sign the token. (still insecure)
'encryption_key' => 'Your ultra secret key to ENCRYPT the token', // Secure token with an ultra password
'expiration_time' => 86400 * 7, // One week till token expires

thanks for any help!

Language files not being picked up?

I have created file langs/en.json + es.json as instructed in readme.md but they are not being picked up, and I can't see anything for internationalization in the code. Any guidance would be appreciated. Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.