Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Quickly build micro services.
Make sure you've got node installed, then make appa
a project dependency:
npm install --save appa
var http = require('http')
var app = require('appa')()
app.on('/', function (req, res, context) {
app.send(res, { message: 'oh hey friends' })
})
http.createServer(app).listen(3000)
The request, response handler that is passed to http.createServer
, and that
provides methods for your app.
Parameters
req
Object – the http request objectres
Object – the http response objectCreate the application. Returns the app
function that can be passed into http.createServer
.
Parameters
options
Object
options.log
Function – a logging function, defaults to console.log
Route handler
Parameters
pathname
String – the route for this handlercallback
Function – the route handlerSend a JSON response
Parameters
res
Object – the http response objectstatusCode
Number – the status code of the response, default is 200data
Object – the data that will be stringified into JSONSend a JSON error response
Parameters
response
Object – the http response objectres
statusCode
Number – the status code of the response, default is 404message
String – the message that will be stringified into JSONFAQs
Quickly create simple JSON API services.
The npm package appa receives a total of 5 weekly downloads. As such, appa popularity was classified as not popular.
We found that appa demonstrated a not healthy version release cadence and project activity because the last version was released 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.