Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 1.45 KB

README.md

File metadata and controls

54 lines (42 loc) · 1.45 KB

ᗊ Ingest

NPM Package Tests Status Coverage Status Commits License

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');
};