mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-27 20:29:39 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
8
tests/dynamic_fixtures/surface/cli_output.golden.txt
Normal file
8
tests/dynamic_fixtures/surface/cli_output.golden.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
Surface map
|
||||
1 entry-point, 0 data stores, 0 external services, 0 dangerous locals
|
||||
|
||||
app.py
|
||||
GET /users (Flask)
|
||||
handler: list_users at app.py:7
|
||||
reaches: (none)
|
||||
|
||||
13
tests/dynamic_fixtures/surface/go_gin/main.go
Normal file
13
tests/dynamic_fixtures/surface/go_gin/main.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package main
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func main() {
|
||||
r := gin.Default()
|
||||
r.GET("/users", listUsers)
|
||||
r.Run()
|
||||
}
|
||||
|
||||
func listUsers(c *gin.Context) {
|
||||
c.JSON(200, []string{})
|
||||
}
|
||||
12
tests/dynamic_fixtures/surface/go_http/main.go
Normal file
12
tests/dynamic_fixtures/surface/go_http/main.go
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package main
|
||||
|
||||
import "net/http"
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/users", listUsers)
|
||||
http.ListenAndServe(":8080", nil)
|
||||
}
|
||||
|
||||
func listUsers(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("[]"))
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.example;
|
||||
|
||||
import io.quarkus.runtime.Quarkus;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
|
||||
@ApplicationScoped
|
||||
@Path("/api")
|
||||
public class GreetResource {
|
||||
|
||||
@GET
|
||||
@Path("/hello")
|
||||
public String hello() {
|
||||
return "hi";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.example;
|
||||
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
|
||||
@Path("/users")
|
||||
public class UserResource {
|
||||
|
||||
@GET
|
||||
@Path("/{id}")
|
||||
public String get() {
|
||||
return "{}";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.example;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class UserController {
|
||||
|
||||
@GetMapping("/users")
|
||||
public String list() {
|
||||
return "[]";
|
||||
}
|
||||
}
|
||||
8
tests/dynamic_fixtures/surface/js_express/server.js
Normal file
8
tests/dynamic_fixtures/surface/js_express/server.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
const express = require("express");
|
||||
const app = express();
|
||||
|
||||
app.get("/users", (req, res) => {
|
||||
res.send("ok");
|
||||
});
|
||||
|
||||
app.listen(3000);
|
||||
8
tests/dynamic_fixtures/surface/js_koa/server.js
Normal file
8
tests/dynamic_fixtures/surface/js_koa/server.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
const Router = require("@koa/router");
|
||||
const router = new Router();
|
||||
|
||||
router.get("/users", async (ctx) => {
|
||||
ctx.body = [];
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
3
tests/dynamic_fixtures/surface/php_laravel/routes.php
Normal file
3
tests/dynamic_fixtures/surface/php_laravel/routes.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
Route::get('/users', 'UserController@index');
|
||||
3
tests/dynamic_fixtures/surface/php_slim/routes.php
Normal file
3
tests/dynamic_fixtures/surface/php_slim/routes.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
$app->get('/users', 'UsersController:list');
|
||||
10
tests/dynamic_fixtures/surface/python_django/urls.py
Normal file
10
tests/dynamic_fixtures/surface/python_django/urls.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from django.urls import path
|
||||
|
||||
|
||||
def admin_view(request):
|
||||
return None
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("admin/", admin_view),
|
||||
]
|
||||
8
tests/dynamic_fixtures/surface/python_fastapi/api.py
Normal file
8
tests/dynamic_fixtures/surface/python_fastapi/api.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
@app.get("/items")
|
||||
def list_items():
|
||||
return []
|
||||
8
tests/dynamic_fixtures/surface/python_flask/app.py
Normal file
8
tests/dynamic_fixtures/surface/python_flask/app.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.get("/users")
|
||||
def list_users():
|
||||
return "ok"
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
class UsersController < ApplicationController
|
||||
def index
|
||||
render json: []
|
||||
end
|
||||
|
||||
def show
|
||||
render json: {}
|
||||
end
|
||||
end
|
||||
5
tests/dynamic_fixtures/surface/ruby_sinatra/app.rb
Normal file
5
tests/dynamic_fixtures/surface/ruby_sinatra/app.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
require 'sinatra'
|
||||
|
||||
get '/users' do
|
||||
'[]'
|
||||
end
|
||||
6
tests/dynamic_fixtures/surface/rust_actix/main.rs
Normal file
6
tests/dynamic_fixtures/surface/rust_actix/main.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
use actix_web::{get, HttpResponse};
|
||||
|
||||
#[get("/users")]
|
||||
async fn list_users() -> HttpResponse {
|
||||
HttpResponse::Ok().finish()
|
||||
}
|
||||
9
tests/dynamic_fixtures/surface/rust_axum/main.rs
Normal file
9
tests/dynamic_fixtures/surface/rust_axum/main.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use axum::{routing::get, Router};
|
||||
|
||||
async fn list_users() -> &'static str {
|
||||
"[]"
|
||||
}
|
||||
|
||||
fn app() -> Router {
|
||||
Router::new().route("/users", get(list_users))
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export async function GET(req: Request): Promise<Response> {
|
||||
return new Response("ok");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue