0.2.0 • Published 1 year ago

code-sample-test v0.2.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Code Sample API

Code Sample API is a lightweight Node.js package that sets up a server to expose doc's code as API endpoints. Simply provide the path to the folder containing your doc's code data file, and the package does the rest!

Features

  • Generate language-specific code.
  • Configurable server port (default is 8080).
  • Easy to set up with a single command.

Installation

You don't need to install the package globally; use npx to run it directly:

npx code-sample-api <folder-path> [port]

Usage

Basic Example

To start the server:

  1. Place your code sample data in a folder, e.g., ./data.
  2. Run the following command:

    npx code-sample-api ./data
  3. By default, the server will start at http://localhost:8080.

Query Parameters

  • languages: Comma-separated list of languages (e.g., csharp,java,php).
  • version: Specify the version of the code sample data.

Supported languages:

  • csharp
  • java
  • php
  • python
  • ruby
  • typescript
  • go
  • http

Custom Port

You can specify a custom port by providing it as the second argument:

npx code-sample-api ./data -p 3000

The server will now run at http://localhost:3000.

Accessing the API

To access the API, use the provided portal link. The exact URL depends on your server configuration.

Requirements

  • Node.js (version 20 or higher)
0.1.2

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago