Coder Social home page Coder Social logo

netcarver / framework-x Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clue/framework-x

0.0 1.0 0.0 462 KB

Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

Home Page: https://framework-x.org/

License: MIT License

PHP 95.41% Shell 4.59%

framework-x's Introduction

Framework X

CI status

Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

Quickstart

Start by creating an empty project directory. Next, we can start by taking a look at a simple example application. You can use this example to get started by creating a new public/ directory with an index.php file inside:

<?php

require __DIR__ . '/../vendor/autoload.php';

$app = new FrameworkX\App();

$app->get('/', function () {
    return React\Http\Message\Response::plaintext(
        "Hello wörld!\n"
    );
});

$app->get('/users/{name}', function (Psr\Http\Message\ServerRequestInterface $request) {
    return React\Http\Message\Response::plaintext(
        "Hello " . $request->getAttribute('name') . "!\n"
    );
});

$app->run();

Next, we need to install X and its dependencies to actually run this project. In your project directory, simply run the following command:

$ composer require clue/framework-x:dev-main

That's it already! The next step is now to serve this web application. One of the nice properties of this project is that is works both behind traditional web server setups as well as in a stand-alone environment.

For example, you can run the above example using the built-in web server like this:

$ php public/index.php

You can now use your favorite web browser or command line tool to check your web application responds as expected:

$ curl http://localhost:8080/
Hello wörld!

Documentation

Hooked? See website for full documentation.

Found a typo or want to contribute? The website documentation is built from the source documentation files in the docs/ folder.

Tests

To run the test suite, you first need to clone this repo and then install all dependencies through Composer:

$ composer install

To run the test suite, go to the project root and run:

$ vendor/bin/phpunit --stderr

Additionally, you can run some simple acceptance tests to verify the framework examples work as expected behind your web server. Use your web server of choice (see deployment documentation) and execute the tests with the URL to your installation like this:

$ php examples/index.php
$ tests/acceptance.sh http://localhost:8080

License

This project is released under the permissive MIT license.

Did you know that I offer custom development services and issuing invoices for sponsorships of releases and for contributions? Contact me (@clue) for details.

framework-x's People

Contributors

bpolaszek avatar clue avatar degra1991 avatar devfrey avatar francislavoie avatar hleithner avatar ivanshamir avatar netcarver avatar rattuscz avatar shuvroroy avatar simonfrings avatar

Watchers

 avatar

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.