Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Eperty123/OpenFusion-Web-API
A web API for Open Fusion (Fusionfall)
https://github.com/Eperty123/OpenFusion-Web-API
Last synced: 7 days ago
JSON representation
A web API for Open Fusion (Fusionfall)
- Host: GitHub
- URL: https://github.com/Eperty123/OpenFusion-Web-API
- Owner: Eperty123
- License: gpl-3.0
- Created: 2020-09-06T11:36:45.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-24T00:34:55.000Z (about 4 years ago)
- Last Synced: 2024-08-02T16:43:59.827Z (3 months ago)
- Language: PHP
- Size: 823 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenFusion-Web-API
A web API for Open Fusion (Fusionfall) written in PHP.# Features
- Fully written in PHP
- Handles login and registration# Usage
## Configure settings inside
> ### inc/config.phpIt's still a work in progress so a bunch of features are missing and expect bugs and unoptimized code.
When you get inside config.php you have to change the value inside BASE_PATH which is the path you've placed the api at (the root folder). So you if have this:
> http://localhost/openffapithen the value is "/openffapi/". Remember to add the dash at the end! You must also change the:
> RewriteBase /inside .htaccess to the same path otherwise the api will redirect you to weird places. No quotes. I repeat absolutely no quotes! The .htaccess is also extremely important! If you don't have that please get it as the api heavily relies on it. Once you have it place it in exact same place as api.php.
The API_PATH is a virtual path in which you'd call any of the api functions. If you change it to say "bieber" then in order to call any api functions you'd have to go to http://localhost/openffapi/bieber/. Default is "api".
As it is right now you have to manually visit either login.php or register.php as the api only handles very basic stuff. You can check out how things work in api.php.## Add to your index.js
// Add underneath var app = require('app');.
var path = require('path');
var fs = require('fs');// Add inside the app.on("ready", function()) method.
//This allows the client to save caches and cookies. You can configure the app name in the package.json file.
var packagePath = app.getAppPath();
var packageJsonPath = path.join(packagePath, 'package.json');
var packageJson = JSON.parse(fs.readFileSync(packageJsonPath));
if (packageJson.version) app.setVersion(packageJson.version);
if (packageJson.productName) app.setName(packageJson.productName);
else if (packageJson.name) app.setName(packageJson.name);
app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
app.setPath('userCache', path.join(app.getPath('cache'), app.getName()));
app.setAppPath(packagePath);
# Note
The sql file provided has all the required tables for the API to work. Other features are yet to be implemented.
## Server
Max length of password must be set to 32 since we'll be comparing hashed passwords and not plain text.