add readme

This commit is contained in:
Henry 2023-05-13 23:33:44 +01:00
parent 05bd7bc793
commit 02ebaa9cab
4 changed files with 21 additions and 1 deletions

View File

@ -86,6 +86,15 @@ Flowise has 3 different modules in a single mono repository.
Any code changes will reload the app automatically on [http://localhost:8080](http://localhost:8080) Any code changes will reload the app automatically on [http://localhost:8080](http://localhost:8080)
## 🔒 Authentication
To enable app level authentication, add `USERNAME` and `PASSWORD` to the `.env` file in `packages/server`:
```
USERNAME=user
PASSWORD=1234
```
## 📖 Documentation ## 📖 Documentation
Coming soon Coming soon

View File

@ -1 +1,3 @@
PORT=3000 PORT=3000
# USERNAME=user
# PASSWORD=1234

View File

@ -20,6 +20,15 @@ Drag & drop UI to build your customized LLM flow using [LangchainJS](https://git
3. Open [http://localhost:3000](http://localhost:3000) 3. Open [http://localhost:3000](http://localhost:3000)
## 🔒 Authentication
To enable app level authentication, add `USERNAME` and `PASSWORD` to the `.env` file:
```
USERNAME=user
PASSWORD=1234
```
## 📖 Documentation ## 📖 Documentation
Coming Soon Coming Soon

View File

@ -76,7 +76,7 @@ export class App {
const basicAuthMiddleware = basicAuth({ const basicAuthMiddleware = basicAuth({
users: { [username]: password } users: { [username]: password }
}) })
const whitelistURLs = ['node-icon', 'static', 'favicon'] const whitelistURLs = ['static', 'favicon', '/api/v1/prediction/', '/api/v1/node-icon/']
this.app.use((req, res, next) => this.app.use((req, res, next) =>
whitelistURLs.some((url) => req.url.includes(url)) || req.url === '/' ? next() : basicAuthMiddleware(req, res, next) whitelistURLs.some((url) => req.url.includes(url)) || req.url === '/' ? next() : basicAuthMiddleware(req, res, next)
) )