Skip to content

Commit 8f38a97

Browse files
author
Admin-Host
committed
Add README and LICENSE
1 parent 9e2f5c6 commit 8f38a97

File tree

4 files changed

+93
-1
lines changed

4 files changed

+93
-1
lines changed

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Admin-Host
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# LENS App
2+
3+
This is a template Node.js web application that demonstrates how to use LENS for authentication.
4+
5+
## Prerequisites
6+
7+
- Node.js (v14 or higher)
8+
- npm (v6 or higher)
9+
10+
## Installation
11+
12+
1. Clone the repository:
13+
14+
```sh
15+
git clone https://github.com/LENSAuth/my-app.git
16+
cd my-app
17+
```
18+
19+
- 1a. Use as template:
20+
21+
To instead use this repository as a template for new projects, click the "Use this template" button on [the GitHub repository](https://github.com/LENSAuth/my-app), or click this link: [Create a new repository](https://github.com/new?template_name=my-app&template_owner=LENSAuth).
22+
23+
![Use this template](githubTemplate.gif)
24+
25+
2. Install all dependencies:
26+
27+
```sh
28+
npm install
29+
```
30+
31+
## Running the App
32+
33+
1. Start the server:
34+
35+
```sh
36+
node index.js
37+
```
38+
39+
2. Open your browser and navigate to `http://localhost:8080`.
40+
41+
## Project Structure
42+
43+
- `index.js`: Main server file that sets up the Express app and handles routes.
44+
- `views/index.ejs`: EJS template file for rendering the main page.
45+
- `.gitignore`: Specifies files and directories to be ignored by Git.
46+
- `package.json`: Contains project metadata and dependencies.
47+
48+
## Usage
49+
50+
### GET Request
51+
52+
- When you navigate to `http://localhost:8080`, the server will render the `index.ejs` file and display "Hello World!".
53+
54+
### POST Request
55+
56+
- The app listens for POST requests at the root URL (`/`). When a POST request is received, it logs the request body to the console and responds with a JSON message.
57+
58+
### Popup Window
59+
60+
- The `index.ejs` file includes a script that opens a popup window to `https://lens.admin-host.com` and listens for messages from this origin.
61+
- When a message is received from the popup, it is logged to the console and displayed on the page.
62+
- The message is also sent to the server via a POST request.
63+
64+
## Notes
65+
66+
- Ensure that the domain you are using is registered with LENS. For testing purposes, you can register `localhost`.
67+
- The server logs the status and received data to the console.
68+
69+
## License
70+
71+
This project is licensed under the MIT License.

githubTemplate.gif

23.9 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"authentication"
1717
],
1818
"author": "Admin-Host",
19-
"license": "ISC",
19+
"license": "MIT",
2020
"bugs": {
2121
"url": "https://github.com/LENSAuth/my-app/issues"
2222
},

0 commit comments

Comments
 (0)