Package Exports
- @stackpress/ingest
- @stackpress/ingest/dist/helpers
- @stackpress/ingest/dist/helpers.js
- @stackpress/ingest/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stackpress/ingest) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ᗊ Ingest
An unopinionated, event driven, pluggable, serverless framework.
Install
npm i @stackpress/ingest
Usage
// src/server.ts
import { server } from '@stackpress/ingest/http';
//make a new app
const app = server();
//add a route
app.get('/', function HomePage(req, res) {
res.setHTML('Hello, World');
});
//start the server
app.create().listen(3000);
Entry Files
You can route to files as well.
import path from 'node:path';
import { server } from '@stackpress/ingest/http';
//make a new app
const app = server();
//add a route
route.get('/', path.join(__dirname, 'home'));
//start the server
app.create().listen(3000);
// src/home.ts
export default function HomePage(req, res) {
res.setHTML('Hello, World');
};