mirror of
				https://codeberg.org/ashley/poke
				synced 2025-07-17 16:52:11 +00:00 
			
		
		
		
	add public inv api :3
This commit is contained in:
		
							parent
							
								
									2f5206b038
								
							
						
					
					
						commit
						ffeefe9b19
					
				
							
								
								
									
										15
									
								
								server.js
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								server.js
									
									
									
									
									
								
							| @ -81,6 +81,7 @@ this is our config file,you can change stuff here | ||||
| */ | ||||
| const config = { | ||||
|   tubeApi: "https://tube.kuylar.dev/api/", | ||||
|   invapi: "https://inv.vern.cc/api/v1", | ||||
|   dislikes: "https://returnyoutubedislikeapi.com/votes?videoId=", | ||||
|   t_url: "https://t.poketube.fun/", //  def matomo url
 | ||||
| }; | ||||
| @ -623,6 +624,20 @@ app.get("/api/redirect", async (req, res) => { | ||||
|   res.redirect(red_url); | ||||
| }); | ||||
| 
 | ||||
| 
 | ||||
| app.get("/api/v1/:endpoint/:id", async (req, res) => { | ||||
|   | ||||
|   var inv_api_fetch = await fetch(`${config.invapi}/${req.params.endpoint}/${req.params.id}`).then((res) => | ||||
|     res.text() | ||||
|   ); | ||||
| 
 | ||||
|   var inv_api_fetch = await JSON.parse(inv_api_fetch); | ||||
|    | ||||
|   res.send(inv_api_fetch) | ||||
|    | ||||
| }); | ||||
| 
 | ||||
| 
 | ||||
| app.get("/api/opensearch", async (req, res) => { | ||||
|   res.sendFile(__dirname + `/opensearch.xml`); | ||||
| }); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Ashley
						Ashley