mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 04:13:58 +00:00
swagger setup
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
https://unity.test/
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
GET
|
|
||||||
user-backsys/api/contract-template/list
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
GET
|
|
||||||
user-backsys/api/contract-template/show/hash_id
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
https://unity.test/
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
POST
|
|
||||||
user-backsys/api/login
|
|
||||||
{
|
|
||||||
"App-Key": "base64:l/rL1EymG3bAXHY6g+ZuPTyJgDm0myx/tBELy9CHcgg="
|
|
||||||
}
|
|
||||||
{
|
|
||||||
"email": "one@izyim.com",
|
|
||||||
"password": "pass123"
|
|
||||||
}
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Auth;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
class SwaggerController extends Controller
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
return view('swagger.app');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Generated
+1416
-896
File diff suppressed because it is too large
Load Diff
+15
-2
@@ -23,7 +23,9 @@
|
|||||||
"chart.js": "^2.8.0",
|
"chart.js": "^2.8.0",
|
||||||
"countup.js": "^1.9.3",
|
"countup.js": "^1.9.3",
|
||||||
"es6-promise": "^4.2.6",
|
"es6-promise": "^4.2.6",
|
||||||
|
"fs": "0.0.1-security",
|
||||||
"increase-memory-limit": "^1.0.6",
|
"increase-memory-limit": "^1.0.6",
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"leaflet": "^1.4.0",
|
"leaflet": "^1.4.0",
|
||||||
"linearicons": "^1.0.1",
|
"linearicons": "^1.0.1",
|
||||||
@@ -90,7 +92,13 @@
|
|||||||
"vuetify": "^1.5.5",
|
"vuetify": "^1.5.5",
|
||||||
"vuetrend": "^0.3.2",
|
"vuetrend": "^0.3.2",
|
||||||
"vuex": "^3.1.0",
|
"vuex": "^3.1.0",
|
||||||
"weekstart": "^1.0.1"
|
"weekstart": "^1.0.1",
|
||||||
|
"clean-webpack-plugin": "^1.0.1",
|
||||||
|
"copy-webpack-plugin": "^4.6.0",
|
||||||
|
"html-webpack-plugin": "^3.2.0",
|
||||||
|
"webpack": "^4.29.3",
|
||||||
|
"webpack-cli": "^3.2.3",
|
||||||
|
"webpack-dev-server": "^3.1.14"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "^3.6.0",
|
"@vue/cli-plugin-babel": "^3.6.0",
|
||||||
@@ -110,6 +118,11 @@
|
|||||||
"stylus-loader": "^3.0.1",
|
"stylus-loader": "^3.0.1",
|
||||||
"vue-cli-plugin-vuetify": "^0.5.0",
|
"vue-cli-plugin-vuetify": "^0.5.0",
|
||||||
"vue-template-compiler": "^2.6.10",
|
"vue-template-compiler": "^2.6.10",
|
||||||
"vuetify-loader": "^1.0.5"
|
"vuetify-loader": "^1.0.5",
|
||||||
|
"css-loader": "^2.1.0",
|
||||||
|
"json-loader": "^0.5.7",
|
||||||
|
"style-loader": "^0.23.1",
|
||||||
|
"swagger-ui": "^3.20.7",
|
||||||
|
"yaml-loader": "^0.5.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
{
|
{
|
||||||
"/admin/js/index.js": "/admin/js/index.js",
|
"/swagger/js/index.js": "/swagger/js/index.js"
|
||||||
"/admin/css/index.css": "/admin/css/index.css",
|
|
||||||
"/user/css/index.css": "/user/css/index.css",
|
|
||||||
"/user/js/index.js": "/user/js/index.js",
|
|
||||||
"/admin/css/editor.css": "/admin/css/editor.css",
|
|
||||||
"/user/css/editor.css": "/user/css/editor.css"
|
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+201
File diff suppressed because one or more lines are too long
Vendored
+15
@@ -0,0 +1,15 @@
|
|||||||
|
// or use require if you prefer
|
||||||
|
const SwaggerUI = require('swagger-ui');
|
||||||
|
require('swagger-ui/dist/swagger-ui.css');
|
||||||
|
|
||||||
|
const spec = require('./swagger-config.yaml');
|
||||||
|
const ui = SwaggerUI({
|
||||||
|
spec,
|
||||||
|
dom_id: '#app',
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.initOAuth({
|
||||||
|
appName: "Swagger UI Webpack Demo",
|
||||||
|
// See https://demo.identityserver.io/ for configuration details.
|
||||||
|
clientId: 'implicit'
|
||||||
|
});
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
openapi: "3.0.0"
|
||||||
|
info:
|
||||||
|
version: "0.0.1"
|
||||||
|
title: "Swagger UI Webpack Setup"
|
||||||
|
description: "Demonstrates Swagger UI with Webpack including CSS and OAuth"
|
||||||
|
servers:
|
||||||
|
- url: "https://demo.identityserver.io/api"
|
||||||
|
description: "Identity Server test API"
|
||||||
|
components:
|
||||||
|
securitySchemes:
|
||||||
|
# See https://demo.identityserver.io/ for configuration details.
|
||||||
|
identity_server_auth:
|
||||||
|
type: oauth2
|
||||||
|
flows:
|
||||||
|
implicit:
|
||||||
|
authorizationUrl: "https://demo.identityserver.io/connect/authorize"
|
||||||
|
scopes:
|
||||||
|
api: "api"
|
||||||
|
security:
|
||||||
|
- identity_server_auth:
|
||||||
|
- api
|
||||||
|
paths:
|
||||||
|
/test:
|
||||||
|
get:
|
||||||
|
summary: "Runs a test request against the Identity Server demo API"
|
||||||
|
responses:
|
||||||
|
401:
|
||||||
|
description: "Unauthorized"
|
||||||
|
200:
|
||||||
|
description: "OK"
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="ROBOTS" content="NOINDEX, FOLLOW">
|
||||||
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
|
<title>{{ config('constants.site.title') }} @yield('title')</title>
|
||||||
|
|
||||||
|
@yield('header_styles')
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>Please enable JavaScript to continue</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script type="text/javascript" src="{{ asset('swagger/js/index.js') . '?v=' . config('constants.version') }}"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -5,3 +5,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
Route::get('unauthorized', ['as' => 'unauthorized', function() {
|
Route::get('unauthorized', ['as' => 'unauthorized', function() {
|
||||||
return response('Unauthorized Access', 401);
|
return response('Unauthorized Access', 401);
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
Route::group(['prefix' => 'swagger-doc'], function () {
|
||||||
|
Route::get('/', ['as' => 'swagger.app', 'uses' => 'SwaggerController@index']);
|
||||||
|
});
|
||||||
|
|||||||
Vendored
+32
-10
@@ -1,5 +1,11 @@
|
|||||||
const mix = require('laravel-mix');
|
const mix = require('laravel-mix');
|
||||||
|
|
||||||
|
mix.extend('addWebpackLoaders', (webpackConfig, loaderRules) => {
|
||||||
|
loaderRules.forEach((loaderRule) => {
|
||||||
|
webpackConfig.module.rules.push(loaderRule);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Mix Asset Management
|
| Mix Asset Management
|
||||||
@@ -12,15 +18,31 @@ const mix = require('laravel-mix');
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
mix
|
mix
|
||||||
.js('resources/js/admin/index.js', 'public/admin/js')
|
// .js('resources/js/admin/index.js', 'public/admin/js')
|
||||||
.sass('resources/sass/admin/index.scss', 'public/admin/css').options({ processCssUrls: false })
|
// .sass('resources/sass/admin/index.scss', 'public/admin/css').options({ processCssUrls: false })
|
||||||
.styles([
|
// .styles([
|
||||||
'resources/sass/admin/editor.css',
|
// 'resources/sass/admin/editor.css',
|
||||||
], 'public/admin/css/editor.css')
|
// ], 'public/admin/css/editor.css')
|
||||||
|
|
||||||
.js('resources/js/user/index.js', 'public/user/js')
|
// .js('resources/js/user/index.js', 'public/user/js')
|
||||||
.sass('resources/sass/user/index.scss', 'public/user/css').options({ processCssUrls: false })
|
// .sass('resources/sass/user/index.scss', 'public/user/css').options({ processCssUrls: false })
|
||||||
.styles([
|
// .styles([
|
||||||
'resources/sass/user/editor.css',
|
// 'resources/sass/user/editor.css',
|
||||||
], 'public/user/css/editor.css')
|
// ], 'public/user/css/editor.css')
|
||||||
|
|
||||||
|
// .js('resources/js/swagger/index.js', 'public/swagger/js').webpackConfig({ node: { fs: 'empty' }})
|
||||||
|
|
||||||
|
.js('resources/js/swagger/index.js', 'public/swagger/js')
|
||||||
|
.addWebpackLoaders([
|
||||||
|
{
|
||||||
|
test: /\.yaml$/,
|
||||||
|
use: 'json-loader'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.yaml$/,
|
||||||
|
use: 'yaml-loader'
|
||||||
|
}
|
||||||
|
])
|
||||||
.sourceMaps();
|
.sourceMaps();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user