
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Rayze is a web framework for easy use base on fastify
Convention over configuration
bun init
bun install rayze
Add script in package.json
"scripts": {
"dev": "rayze",
"pkg": "rayze build"
},
{
"compilerOptions": {
// Enable latest features
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false,
// typeorm
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false
}
}
- src
- routes
- hello.ts
And hello.ts will auto gen http://localhost:8080/hello
import { Route } from 'rayze'
export default {
handler: async (req) => {
console.log(req.query())
return 'hello rayze!'
// return { xxx: yyy } // or json
},
} as Route
import { Route } from 'rayze'
export default {
method: 'POST',
url: '/user/:id',
handler: async (req, reply) => {
req.param()
reply.status(500)
return ''
},
} as Route
rayze use
typeorm
touch .env
DB_TYPE=postgres
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=postgres
DB_USERNAME=postgres
DB_PASSWORD=123456
DB_SYNCHRONIZE=true
bun install pg
- src
- models
- user.ts
And user.ts
import { Column, Entity, Model } from 'rayze'
@Entity({ name: 'user' })
export class User extends Model {
@Column({ name: 'nickname' })
nickname: string
@Column({ name: 'username', nullable: true })
username?: string
}
const { manager } = this.orm // this is the fastify instant
const find = await manager.findOneBy(User, { id: 1 })
you can add anything what you like of
startup.ts
-src
- hooks
- startup.ts
And startup.ts
export default {
async onReady() {
this.orm.xxx // code your startup
},
async onRequest(req, reply) {
this.log.info('income') // this is the fastify instance
},
// or anything fastify hook
} as Hook
all the fastify hooks, and ext preReady application hook that run before onReady.
By default, in-memory caching is used.
When the REDIS_URL environment variable is set, Redis will be used.
this.cache.get('key')
this.cache.set('key', anyValue, expireMsNum)
bun pkg
./dist/app
touch Dockerfile and run docker build -t appName:version .
FROM oven/bun:alpine as builder
WORKDIR /workspace
COPY package.json ./
RUN bun install
COPY ./ ./
RUN bun pkg
FROM alpine
RUN apk --no-cache add libstdc++
WORKDIR /workspace
ENV MODE=production \
PORT=8080
HEALTHCHECK --interval=5s --timeout=3s --retries=5 --start-period=5s \
CMD wget --spider http://127.0.0.1:$PORT/rayze/health || exit 1
COPY --from=builder /workspace/dist/app /workspace/app
EXPOSE $PORT
ENTRYPOINT ["./app"]
Touch Dockerfile
FROM oven/bun:1.2-alpine AS builder
WORKDIR /workspace
ENV MODE=production \
PORT=8080
EXPOSE $PORT
HEALTHCHECK --interval=5s --timeout=3s --retries=5 --start-period=5s \
CMD wget --spider http://127.0.0.1:$PORT/rayze/health || exit 1
COPY dist/app.js ./
COPY dist/app.js.map ./
ENTRYPOINT ["/bin/sh", "-c", "bun app.js"]
And run
bun pkg -j true
docker build -t appName:version .
package.json
{
"dependencies": {
"rayze": "file:../rayze"
}
}
FAQs
Rayze is a web framework for easy use base on fastify
We found that rayze demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.