https://github.com/naugtur/sup-project-scaffold
https://github.com/naugtur/sup-project-scaffold
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/naugtur/sup-project-scaffold
- Owner: naugtur
- Created: 2022-05-09T09:54:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-09T12:04:56.000Z (over 3 years ago)
- Last Synced: 2025-02-15T07:32:13.327Z (8 months ago)
- Language: JavaScript
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DappDesk or sup-dapp
## script
To edit the script go to /src
It gets built with parcel into a static file that ends up deployed as public url.Run `npm run script:build` to have a clean build of the script
Run `npm run script:watch` for it to auto-update - note parcel adds a bunch of runtime in that case
## backend
You need vercel installed.
`npm i -g vercel`put your secret in `.env` (see `.env.template`)
Run the backend with `npm run localdev` or run both backend and parcel watch with `npm start`
A function that generates the script text to be pasted into someone's document:
`http://localhost:3000/api/generate?wallet=123&projectName=kaboom`
Returns
```
window['sup-dapp'] = {
conf: {
"projectName": "karramba"
}
id: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3YWxsZXQiOiIxMjMiLCJpYXQiOjE2NTIwODkyNjZ9.RDCXu01U5Mv361RYQ4Sv63zG-8t5z6ve2uBUS5VwphE',
}```
Remove the integrity bit when you want to livereload while in development.
When running localdev it seems vercel is passing some internal port to the host header, so the script url generated locally is not correct. It will work when deployed. For local run you need to replace stuff like `https://127.0.0.1:41487` with `http://localhost:3000`