-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path71 backend.php
70 lines (56 loc) · 1.65 KB
/
71 backend.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
// This is a basic PHP File.
// and that is cool enough.
// Include BaaS-Server
include 'BaaS-Server.php';
// Initialize BaaS Server
$server = BaaS\Server::shared();
// Set Connection type
$server->setDatabase(
// Type
'MySQL',
// Host
'localhost',
// Database name
'DATABASE',
// Username
'USERNAME',
// Password
'PASSWORD'
);
// $server->setDatabase(
// // Type
// 'SQLite',
// // Database Path
// 'Data/database.sqlite'
// );
// always send this key in your post requests, otherwise it will not answer your request at all. (no error, b/c of bruteforcing)
$server->setRegisteredAPIkey('DEVELOPMENT_UNSAFE_KEY');
// Set maximum invalid tries (invalid API key)
// Default: 3, probally high enough.
$server->setMaximumInvalidTries(3);
// Set reset time for invalid retries.
// In STRTIME format.
// Default: +24 hours
$server->setTriesTime("+24 hours");
// Set debug level (overwrites Maximum retries)
// Default: off
$server->setDebugMode(true);
// Set server's email address to send emails from
$server->setEmailAddress("no-reply@wesleydegroot.nl");
// Set server's activation page (register, reset password, activate)
// This must be public (see BaaS_Actions.php for a example).
// If you want to use the default one. comment bellow
// $server->setUserActionAddress("http://127.0.0.1/BaaS_Actions.php");
// Attach and load Extension.
$server->attachExtension(
// Extension URL
"test.extension",
// Callable extension function.
// See: Data/demo_extension.php
"myExtension::myFunction",
// API Key Required? (optional parameter, defaults to true)
true
);
// Serve
echo $server->serve();