🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

apeframework

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apeframework

Node.js API framework.

0.0.0-dev.1
Source
npm
Version published
Weekly downloads
104
550%
Maintainers
1
Weekly downloads
 
Created
Source

Ape Framework

Node.js API framework.

NPM package: apeframework

GitHub repository: ApeCommerce/ape-framework

Installation

npm install apeframework

Hello Ape!

Let's make an API serving a /hello endpoint, in TypeScript.

Create a boot.ts file at the root of the project:

import type { Boot, Bundle } from 'apeframework/app';

const welcome: Bundle = {
  bundleId: 'welcome',
  name: 'Welcome',
  routes: async () => [
    {
      endpoint: {
        method: 'GET',
        path: '/hello',
      },
      handler: async (request, reply) => reply.send('Hello Ape!'),
    },
  ],
};

const boot: Boot = {
  bundles: async () => [welcome],
};

export default boot;

Start the API using Ape Framework's CLI:

npx ape-cli-ts api start

Request the API:

curl http://localhost:3000/hello

Keywords

ape

FAQs

Package last updated on 19 Dec 2023

Did you know?

Socket

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.

Install

Related posts