GithubHelp home page GithubHelp logo

francescoborzi / tc-json-api Goto Github PK

View Code? Open in Web Editor NEW
43.0 12.0 33.0 5.08 MB

Mock example of a TrinityCore RESTful API

License: GNU Affero General Public License v3.0

PHP 93.97% JavaScript 0.25% ApacheConf 0.10% HTML 5.68%

tc-json-api's Introduction

TrinityCore JSON REST API

This software provides an easy to use RESTful API for TrinityCore available via HTTP, which delivers the most important database contents in simple JSON format. It is written using Laravel PHP framework.

Our goal is to build a strong, reliable base on which you can build awesome web applications for TrinityCore (e.g. search engines, visual database editors, server administration tools, armories, etc...).

TrinityCore JSON API

The JSON API makes it easier to build your web applications, because you do not have to worry about accessing directly the database, and the data are provided into a very friendly format for front-end web programming languages.

Also, a single instance of the TrinityCore JSON API can be a data provider for multiple web applications, even among separated machines.

Documentation

Take a look at the API documentation to see all the API features and to know how to use them.

Installation

Installation instructions are available here.

Contributing

We need your help to reach our goal in building a valid API for TrinityCore. If you don't know the Laravel framework, this is a good chance for you to learn it.

If you don't want to code, you can simply help us by telling us your suggestion about this API or by reporting any bugs, in these cases please fill an issue here.

or you can donate to support us

Donate

License

The TrinityCore JSON API is open-sourced software licensed under the GNU AGPL license.

tc-json-api's People

Contributors

avengerweb avatar flashadvocate avatar francescoborzi avatar helias 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

Watchers

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

tc-json-api's Issues

Error while processing compiled.php

I installed your API v0.5. Sadly the index page is not loading.

Error in storage/logs:
production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Maximum execution time of 60 seconds exceeded' in [...]/TC-JSON-API/vendor/compiled.php:11934 Stack trace: #0 {main}

Could this be a problem on your side? It seems that the script is not terminating.

System info:
Debian Jessie
PHP 5.6 latest; compiled amongst others with the from this project needed support for: mcrypt, sqlite, openssl, mbstring, tokenizer
Apache 2.4 latest

Error when viewing.

Just grabbed latest release FULL.TrinityCore.JSON.REST.API.0.7 but unsure about what is wrong here.
May you take a look please. using xamp with php 7.1.4

[2017-06-30 13:03:24] production.ERROR: ErrorException: Function mcrypt_get_iv_size() is deprecated in C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php:12241 Stack trace: #0 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(12241): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Function mcrypt...', 'C:\\xampp\\htdocs...', 12241, Array) #1 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(12232): Illuminate\Encryption\Encrypter->updateBlockSize() #2 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(6796): Illuminate\Encryption\Encrypter->setCipher('rijndael-128') #3 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1066): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array) #4 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1019): Illuminate\Container\Container->build(Object(Closure), Array) #5 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1543): Illuminate\Container\Container->make('encrypter', Array) #6 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1111): Illuminate\Foundation\Application->make('encrypter') #7 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1095): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #8 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1081): Illuminate\Container\Container->getDependencies(Array, Array) #9 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1019): Illuminate\Container\Container->build('Illuminate\\Cook...', Array) #10 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1543): Illuminate\Container\Container->make('Illuminate\\Cook...', Array) #11 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(9236): Illuminate\Foundation\Application->make('Illuminate\\Cook...') #12 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(2589): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #13 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(9236): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #14 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #15 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(9227): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #16 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1996): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #17 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1983): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #18 C:\xampp\htdocs\TC-JSON-API\public\index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #19 {main} [2017-06-30 13:03:24] production.ERROR: ErrorException: Function mcrypt_get_iv_size() is deprecated in C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php:12241 Stack trace: #0 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(12241): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Function mcrypt...', 'C:\\xampp\\htdocs...', 12241, Array) #1 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(12232): Illuminate\Encryption\Encrypter->updateBlockSize() #2 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(6796): Illuminate\Encryption\Encrypter->setCipher('rijndael-128') #3 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1066): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array) #4 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1019): Illuminate\Container\Container->build(Object(Closure), Array) #5 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1543): Illuminate\Container\Container->make('encrypter', Array) #6 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1111): Illuminate\Foundation\Application->make('encrypter') #7 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1095): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #8 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1081): Illuminate\Container\Container->getDependencies(Array, Array) #9 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1019): Illuminate\Container\Container->build('Illuminate\\Cook...', Array) #10 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1543): Illuminate\Container\Container->make('Illuminate\\Cook...', Array) #11 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(2002): Illuminate\Foundation\Application->make('Illuminate\\Cook...') #12 C:\xampp\htdocs\TC-JSON-API\public\index.php(60): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpFoundation\Response)) #13 {main}

Mutli realms

Hello,
A feature to load multiple characters database would be awesome.

404 not found

Hey, i'm getting a 404 not found on any route. I can see public/index.php just fine, but i can't access any route.
image
image

ERROR: API not found

Hello,

I've tried to change the path a bunch of times and it still gives me the error
"ERROR: API not found, please edit your config.js file and set the path of your TrinityCore JSON API istance."

I've also tried to change the db's conection manually like indicated on the tutorial but still nothing..

Write data?

Hi, thanks about this library,

I dont see feature for write data in database, not is possible?

maintainability

Hi,

at first thank you for making an API for TC.
After I've looked at the code, I saw that you wrote the most of the application logic into routes.php.

At the moment the routes.php has about 1700 lines of code. In my opinion this is bad for the maintainability.

Do you have a specific reason why you did this so?

Would you merge a pull request if I change the structure into multiple controllers?

Readme unclear

Hey,
I wanted to set-up your tool, but it keeps crashing.
I downloaded the complete package (Easy version). I don't have a ' .env' file in my downloaded folder so I opened up config/database.php manually and set the login information.
I still get this error:

[2016-01-01 09:49:59] production.ERROR: exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)' in /Applications/XAMPP/xamppfiles/htdocs/TC-JSON-API/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47

I guess its not reading/ cannot read my config file? Permission are all ok. Where could be the error?

Add multi-language information

TC DB is multi-language and multi-language information how to return?now for example only return item_template not local_item,maybe we can return all or can be choose

How to show debug info?

I try TC-JSON-API recently.
But these days when I try to query,it display that : http 500
when I open /TC-JSON-API/public/index.php
It told me that "Whoops, looks like something went wrong."
I open php error display and found nothing about this error.
How to set TC-JSON-API to show debug info?

TC-JSON-API AzerothCore support

The TC-JSON-API is compatible with AzerothCore except for following routes:

CREATURE

  • creature/equip_template/
  • creature/queststarter/id/
  • creature/questender/id/
  • creature/questitem/

GAMEOBJECT

  • gameobject/queststarter/id/
  • gameobject/queststender/id/
  • gameobject/questitem

QUEST

  • search/quest
  • quest/template/{name}
  • quest/template/title/
  • quest/template/addon/
  • quest/details/
  • quest/objectives/
  • quest/offer_reward/
  • quest/request_items

VENDOR

  • vendor/creature/
  • vendor/item/

TRAINER

  • npc_trainer/creature/{id} ID should be entry
  • npc_trainer/spell/ SpellID should be spell

LOOT TEMPLATES

  • loot/*/{id}
  • loot/template/*/{id} Entry -> entry

CHARACTERS - /auction

AUTH - /uptime

OTHER - /custom/GetQuestTitleByCriteria/

Unusued-Guid-Search

  • creature_equip_template | CreatureID -> id
  • game_event

Some suggestions

1.IN .env what parameters can be set?
2.TC DB is multi-language and multi-language information how to return?now for example only return item_template not local_item,maybe we can return all or can be choose
3.Access control.For example,connect with other account control center or have own account system that like dev.battle.net ,If it is public, there will be security problems or pose a threat to the server.

Whoops! Something went wrong! (WelcomeController)

Operating System: Ubuntu Server 16.04
PHP: PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )

I've attached my log file with the error. Any help would be appreciated. :)

laravel-2016-12-18.txt

Update: I noticed the WorldController.php file queries the world database for its version. Upon manually entering the query, MySQL returns "Empty set". Would this cause the Undefined offset error?

Update #2: After installing Keira2, it seems to search fine; however, it does display: ERROR: API not found, please edit your config.js file and set the path of your TrinityCore JSON API istance. at the top. I have it pointing at the correct file path for the index.php file.

Fix: The system queries the version table in the world database for information. In the latest revision of TrinityCore, for a fresh database installation, it seems to not dump this information into the version table, which leads to the "Undefined offset: 0" error in the log file above. The fix is to manually add your version information into the table, and then restart Apache, nginx, or the built-in Web server. (Note: This fix was tested on both versions 0.6 and 0.7 of the API.)

Error when Install TC-JSON-API

Hi guys, I install TC_JSON_API on xampp and get this error on log. I'm newbie, someone help me please.

[2017-07-14 05:19:07] production.ERROR: ErrorException: Function mcrypt_get_iv_size() is deprecated in C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php:12241
Stack trace:
#0 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(12241): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8192, 'Function mcrypt...', 'C:\xampp\htdocs...', 12241, Array)
#1 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(12232): Illuminate\Encryption\Encrypter->updateBlockSize()
#2 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(6796): Illuminate\Encryption\Encrypter->setCipher('rijndael-128')
#3 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1066): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption{closure}(Object(Illuminate\Foundation\Application), Array)
#4 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1019): Illuminate\Container\Container->build(Object(Closure), Array)
#5 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1543): Illuminate\Container\Container->make('encrypter', Array)
#6 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1111): Illuminate\Foundation\Application->make('encrypter')
#7 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1095): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#8 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1081): Illuminate\Container\Container->getDependencies(Array, Array)
#9 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1019): Illuminate\Container\Container->build('Illuminate\Cook...', Array)
#10 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(1543): Illuminate\Container\Container->make('Illuminate\Cook...', Array)
#11 C:\xampp\htdocs\TC-JSON-API\vendor\compiled.php(2002): Illuminate\Foundation\Application->make('Illuminate\Cook...')
#12 C:\xampp\htdocs\TC-JSON-API\public\index.php(60): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpFoundation\Response))
#13 {main}

Error accessing

when I type the address in the browser the following error appears:

Parse error: syntax error, unexpected '[' in /home/u748536103/public_html/truice/TC-JSON-API/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 49

Could you help me with this?

Error php

Hello,

Here I have a php error I do not understand why I all properly installed

Here is a picture

Additional Info

Use php-5.6.18
Use Uwamp
Use DB TrinityCore 6.x

passport?

Any plans to implement passport? I realize this will require moving the codebase to 5.4, but if this is desirable, I can contribute toward that end

Add Access control

Access control.For example,connect with other account control center or have own account system that like dev.battle.net ,If it is public, there will be security problems or pose a threat to the server.

JWTAuth not found

PHP Fatal error: Class 'Tymon\JWTAuth\Providers\LumenServiceProvider' not found in C:\xampp\htdocs\TC-JSON-API\vendor\laravel\framework\src\Illuminate\Foundation\Application.php on line 598
Script php artisan clear-compiled handling the post-update-cmd event returned with error code 255

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.