You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run a local PHP server listening `public/index.php`
81
32
82
-
You need to put a `.htaccess` file in the `.well-known/lnurlp/` of your web root directory with the following content
83
-
84
-
```
85
-
RewriteEngine On
86
-
RewriteCond %{REQUEST_FILENAME} !-d
87
-
RewriteCond %{REQUEST_FILENAME} !-f
88
-
RewriteCond %{REQUEST_FILENAME}.php -f
89
-
RewriteRule (.*) $1.php [L]
33
+
```bash
34
+
composer serve
90
35
```
91
36
92
-
Please note that `.htaccess` file will not be read if the Apache configuration doesn't allow configuration overriding, please see Apache documentation regarding `AllowOverride` directive.
93
-
94
-
## Without rewriting URL
95
-
96
-
You might be able to configure your web server to let the PHP backend handle specific files, in that way the script can be named without `.php` extension and URL rewriting is thus not needed.
97
-
98
-
## Usage
99
-
100
-
### Rename & move the script to the right directory
101
-
102
-
Once the web server is configured to rewrite url requests `.well-known/lnurlp/anything` to `.well-known/lnurlp/anything.php`, the `index.php` (inside `public/`) script needs to be renamed with the wanted username part of the [lightning address](https://lightningaddress.com/), such as for a wanted ln address `[email protected]`, the script must be named `ben.php`.
103
-
104
-
Then, the script needs to be in the subdirectory `.well-known/lnurlp/` of your web root directory of your web server such as https://www.yourwebsite.dne/.well-known/lnurlp/ points to your `$WEBROOT/.well-known/lnurlp/` directory.
105
-
106
-
### Set API endpoint & API Key
107
-
108
-
The following need to be changed according to your `apiEndpoint` and `apiKey` that your LNbits wallet provides, be sure to use the **invoice/read key**.
We prepared a demo template, so you can use this project as a dependency. The benefits from this approach is that you can easily update your project with `composer update` whenever there are new features or improvements on this `lnaddress` repository.
126
40
127
-
> **Please note that the `min` and `max` do not reflect the actual min/max sendable amount, it depends on the capacity
To add a new [lightning address](https://lightningaddress.com/), the only thing needed is copying and pasting the script, **don't forget to change the API Key if you want the funds to be received on another wallet**, and name the file with the user part of the [lightning address](https://lightningaddress.com/) wanted.
45
+
Check the wiki for more details: [https://github.com/php-lightning/lnaddress/wiki](https://github.com/php-lightning/lnaddress/wiki)
0 commit comments