add init demos
This commit is contained in:
		
							
								
								
									
										24
									
								
								server/code/root/light-code-demo/main.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								server/code/root/light-code-demo/main.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
import { QueryRouterServer } from "@kevisual/router";
 | 
			
		||||
 | 
			
		||||
const app = new QueryRouterServer();
 | 
			
		||||
 | 
			
		||||
app.route({
 | 
			
		||||
  path: 'main'
 | 
			
		||||
}).define(async (ctx) => {
 | 
			
		||||
  ctx.body = {
 | 
			
		||||
    message: 'this is main. filename: root/light-code-demo/main.ts',
 | 
			
		||||
    params: ctx.query
 | 
			
		||||
  }
 | 
			
		||||
}).addTo(app)
 | 
			
		||||
 | 
			
		||||
app.route({
 | 
			
		||||
  path: 'main2'
 | 
			
		||||
}).define(async (ctx) => {
 | 
			
		||||
  ctx.body = {
 | 
			
		||||
    message: 'this is main2. filename: root/light-code-demo/main.ts',
 | 
			
		||||
    params: ctx.query
 | 
			
		||||
  }
 | 
			
		||||
}).addTo(app)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
app.wait()
 | 
			
		||||
		Reference in New Issue
	
	Block a user