Giter VIP home page Giter VIP logo

simple-jokes's Introduction

Simple Jokes Demo Application

Requirements

  • PHP 7.2.5 or higher
  • PDO-SQLite PHP extensions enabled

Installation

If you do not already have the symfony binary installed, install it first via https://symfony.com/download.

From the command line:

  1. Clone the repository in desired location:
  2. Install the packages (assumes that you have composer installed)
    • cd simple-jokes
    • composer install
  3. Migrate the database tables
    • php bin/console doctrine:migrations:migrate
  4. Seed the database with jokes (optional)
    • php bin/console doctrine:fixtures:load
  5. Run the server
    • symfony server:start

API Documents

Usage

Seeding the joke database (pre-population)

  • from the command console run if not done during installation: php bin/console doctrine:fixtures:load

Running locally

Creating/adding jokes

  • basic validation:
    • joke must be a minimum of 10 characters

Accessing the API

It can be accessed via Curl. For example: - curl http://127.0.0.1:8000/api/jokes

Or it can be accessed via the browser or using Postman.

Tests

Note: the tests have been started but have not been fully implemented.

Run migration and load fixtures

  • php bin/console doctrine:migrations:migrate --env=test
  • php bin/console doctrine:fixtures:load --env=test

Run PHPUnit

  • php bin/phpunit

simple-jokes's People

Watchers

James Cloos avatar Don Cranford 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.