πŸ“¬ Lightweight Typescript-first framework built on top of Express

Related tags

Learning resource a
Overview

πŸ”– abstain

Lightweight Typescript-first framework built on top of Express [WIP]

πŸ“š api

// index.ts
import { Application } from '@pinkcig/abstain';
import { resolve } from 'node:path';

new Application({
	name: 'my-api',
	port: process.env.PORT ?? 3000,
	address: process.env.ADDRESS ?? '0.0.0.0',

	// Set by default, but can be overridden
	controllers: resolve(__dirname, 'controllers'),

	// Set by default, but can be overridden
	logger: new MyOwnLoggerImplementation(),
}).launch((app) => {
	// Some services to run after the application is launched
});
// controllers/index.ts
import { Controller, Get, Post } from '@pinkcig/abstain';
import { Response, Request } from 'express';

@
export class AppController extends Controller {
	@Get('/')
	async index() {
		// https://github.com/omniti-labs/jsend
		return this.respond({ status: 'success', data: { message: 'Hello, World!' } } /*, 200 is used by default */);
	}

	@Post('/')
	async post(request: Request, response: Response) {
		// WIP, prone to MUCH change
		const { name, from } = this.validate(
			request.body,
			s.object({
				name: s.string.default('Faye'),
				from: s.string,
			}).ignore
		);

		return this.respond({ status: 'success', data: { message: `Hello ${name} from ${from}!` } });
	}
}
You might also like...

Express.js framework boilerplate with TypeScript, Prisma, ESLint, Husky and Jest

Express.js framework boilerplate with TypeScript, Prisma, ESLint, Husky and Jest

Setup a Node.js project with Typescript, Prisma ESLint, Prettier, Husky Node.js boilerplate with Express.js, TypeScript, Prisma, ESLint, Prettier, Hus

Dec 12, 2022

A Restaurant (Table) Reservation API built with Node, TypeScript, Express, TypeORM, a MySQL DB, all running on Docker containers

Restaurant (Table) Reservation API A simple API for reserving tables at a restaurant. The API is based on the REST architectural style and uses Node.j

Oct 5, 2022

A Restaurant (Table) Reservation API built with Node, TypeScript, Express, TypeORM, a MySQL DB, all running on Docker containers

Restaurant (Table) Reservation API A simple API for reserving tables at a restaurant. The API is based on the REST architectural style and uses Node.j

Oct 5, 2022

RepoProvas API, a system for sharing tests between students, built with Typescript, Node.js, Express, Prisma and Postgres.

Repoprovas Built With πŸ“‹ Description RepoProvas API, a system for sharing tests between students, built with Typescript, Node.js, Express, Prisma and

Dec 13, 2022

A Node.js REST API example built with Express and Typescript that can be used as template for creation of new servers.

api-example-firebase-nodejs A Node.js REST API example built with Express and Typescript that can be used as template for creation of new servers. The

Nov 25, 2022

An API built for an invoices manager app using TypeScript and Prisma with Node and Express.

Invoices App API An API built for the invoices manager app using TypeScript and Prisma with Node and Express. Run locally To run locally, you need to

Oct 17, 2022

An express-ve way to start an express project

Express-ve express starter An express-ve way to start an express project. Checkout a demo project here or Learn how to use express-ve here Are you sta

Mar 28, 2022

A next-gen web framework made on top of bun

Eviate JS (WIP) Next-generation web framework to build powerful apps Features Simple: No more req or res. It's all ctx (context) and plain objects! Fa

Oct 30, 2022

Deno's first lightweight, secure distributed lock manager utilizing the Redlock algorithm

Deno-Redlock Description This is an implementation of the Redlock algorithm in Deno. It is a secure, lightweight solution to control resource access i

Dec 31, 2022
Owner
Faye Keller
she/her βˆ™ socially awkward
Faye Keller
`raaghu-mfe` is an opensource micro front end framework built on top of `raaghu-elements`, Bootstrap 5 and Storybook offering highly customizable UI components and built-in pages

`raaghu-mfe` is an opensource micro front end framework built on top of `raaghu-elements`, Bootstrap 5 and Storybook offering highly customizable UI components and built-in pages. Raaghu mfe can be used as a base to build complex components and UI layouts whilst maintaining a high level of reusability,flexibility with ease of maintenance.

Wai Technologies 160 Dec 30, 2022
Movehat is a TypeScript SDK for Move on Sui built on top of Sui's TypeScript SDK and our fork of Ian Macalinao's `move-ts`.

Movehat Movehat is a TypeScript SDK for Move on Sui built on top of Sui's TypeScript SDK and our fork of Ian Macalinao's move-ts. Movehat aspires to b

Pentagon 10 Sep 30, 2022
GraphQL-first boilerplate that scales with TypeScript + Node Express + Apollo GraphQL APIs.

graphql-typescript-boilerplate A boilerplate project for quickly building Graphql APIs and with typescript ?? Installation Install the dependencies: y

Youssef Hajjari 6 May 15, 2022
A lightweight, scalable, mobile-first CSS framework

Mobi.css A lightweight, scalable, mobile-first CSS framework Homepage Features Lightweight The default bundle of Mobi.css provides the basic styles to

Mobi.css 2.3k Dec 21, 2022
πŸš€ Using top-level await in AWS Lambda with TypeScript, esbuild and Serverless Framework

?? Top-level await in AWS Lamba with TypeScript Articles https://dev.to/oieduardorabelo/top-level-await-in-aws-lamba-with-typescript-1bf0 https://medi

Eduardo Rabelo 17 Nov 23, 2022
⚑ the first open-source redis client made with care and acessibility-first πŸš€

⚑ Redis UI The first open-source project to create an awesome and accessible UI for Redis as a native desktop application. ✨ ?? ?? How to develop loca

Nicolas Lopes Aquino 14 Dec 5, 2022
Clinton Mbonu 20 Jun 30, 2022
Run REST APIs in Node.js applications frameworks (Express, Koa, Hapi and Fastify) on top of any Serverless Cloud.

?? Serverless Adapter Install | Usage | Support | Architecture | Credits Run REST APIs and other web applications using your existing Node.js applicat

Vinicius Lourenço 45 Jan 1, 2023
⚑️ Next-generation data transformation framework for TypeScript that puts developer experience first

TypeStream Next-generation data transformation framework for TypeScript that puts developer experience first Nowadays, almost every developer is worki

Scopas Technologies 53 Nov 26, 2022
Lightweight (zero dependencies) library for enabling cross document web messaging on top of the MessageChannel API.

Lightweight (zero dependencies) library for enabling cross document web messaging on top of the MessageChannel API.

LironH 4 Jul 15, 2022