New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ape-framework/common

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ape-framework/common

Node.js API framework.

  • 0.0.0-dev.2
  • unpublished
  • dev
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Ape Framework

Node.js API framework.

NPM packages:

GitHub repository: ApeCommerce/ape-framework

Installation

Server side:

yarn add @ape-framework/server

Client side or within a shared library:

yarn add @ape-framework/common

The common package contains interfaces for a client application to interact with the server. It is a subset of the server package and has no dependency.

Hello Ape!

Let's create an API serving a /hello endpoint.

Define a hello bundle:

// bundle/hello.ts
import { Bundle } from '@ape-framework/server/boot/bundle';
import sendResponse from '@ape-framework/server/api/handler';

const bundle: Bundle = {
  bundleId: 'hello',
  name: 'The hello bundle',
  routes: [
    {
      endpoint: {
        method: 'GET',
        path: '/hello',
      },
      handler: () => sendResponse('Hello Ape!'),
    },
  ],
};

export default bundle;

Define the boot module:

// boot.ts
import { Boot } from '@ape-framework/server/boot';

const boot: Boot = {
  bundleModules: ['bundle/hello'],
};

export default boot;

Start the API:

yarn ape-cli api start

Request the endpoint:

curl http://localhost:3000/hello

FAQs

Package last updated on 15 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc