Add sample Lubes project files
- Add index.ts with SDK usage examples - Add package.json with dependencies - Add .gitignore - Update README with quick start guide
This commit is contained in:
parent
d9ff298cf6
commit
96f58c10dc
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
node_modules/
|
||||
dist/
|
||||
.env
|
||||
.env.local
|
||||
*.log
|
||||
31
README.md
31
README.md
|
|
@ -1,2 +1,31 @@
|
|||
# hot-repo
|
||||
# Hot Repo
|
||||
|
||||
A sample project demonstrating Lubes platform features.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Set environment variables
|
||||
export LUBES_PROJECT_ID="your-project-id"
|
||||
export LUBES_API_KEY="your-api-key"
|
||||
|
||||
# Run the application
|
||||
npm start
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Database queries via Lubes SDK
|
||||
- File storage with S3-compatible API
|
||||
- Serverless functions
|
||||
|
||||
## Deploy
|
||||
|
||||
```bash
|
||||
git push lubes main
|
||||
```
|
||||
|
||||
Pushing to the Lubes remote triggers automatic deployment.
|
||||
|
|
|
|||
22
index.ts
Normal file
22
index.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Lubes Hot Repo - Main Entry Point
|
||||
import { Lubes } from '@lubes/sdk'
|
||||
|
||||
const client = new Lubes({
|
||||
projectId: process.env.LUBES_PROJECT_ID!,
|
||||
apiKey: process.env.LUBES_API_KEY!,
|
||||
})
|
||||
|
||||
async function main() {
|
||||
// Query the database
|
||||
const users = await client.db.query('SELECT * FROM users LIMIT 10')
|
||||
console.log('Users:', users)
|
||||
|
||||
// Upload a file to storage
|
||||
await client.storage.upload('avatars', 'example.png', Buffer.from('...'))
|
||||
|
||||
// Call a serverless function
|
||||
const result = await client.functions.invoke('hello-world', { name: 'Lubes' })
|
||||
console.log('Function result:', result)
|
||||
}
|
||||
|
||||
main().catch(console.error)
|
||||
18
package.json
Normal file
18
package.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "hot-repo",
|
||||
"version": "1.0.0",
|
||||
"description": "Lubes Hot Repo - Example Project",
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"start": "ts-node index.ts",
|
||||
"build": "tsc",
|
||||
"deploy": "lubes deploy"
|
||||
},
|
||||
"dependencies": {
|
||||
"@lubes/sdk": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.0",
|
||||
"ts-node": "^10.0.0"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue