Coder Social home page Coder Social logo

alien-swaggerui's Introduction

NAME

Alien::SwaggerUI - Render OpenAPI spec documentation with Swagger-UI

VERSION

version 0.002

STATUS

Coverage Status

SYNOPSIS

use Alien::SwaggerUI;
my $app_dir = Alien::SwaggerUI->root_dir;

#-- Serve Swagger-UI with Mojolicious::Lite
use File::Spec::Functions qw( catfile );
use Alien::SwaggerUI;
use Mojolicious::Lite;

get '/swagger/*path' => { path => 'index.html' }, sub {
    my ( $c ) = @_;
    my $path = catfile( Alien::SwaggerUI->root_dir, $c->stash( 'path' ) );
    my $file = Mojo::Asset::File->new( path => $path );
    $c->reply->asset( $file );
};

app->start;

DESCRIPTION

This module contains Swagger UI. This pure-JavaScript application renders beautiful documentation for your application's OpenAPI specification.

The application is contained in a share/ directory. You can get the path to this directory with the root_dir method.

To render your specific API documentation, pass it in with the ?url=/path/to/spec query parameter.

SEE ALSO

AUTHOR

Doug Bell [email protected]

CONTRIBUTORS

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by Doug Bell.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.