File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 5050 if : github.ref == 'refs/heads/develop'
5151 run : |
5252 ssh ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }} << 'EOF'
53+ export REMOTE_URLS=${{ secrets.REMOTE_URLS }}
5354 pm2 stop setonix-servers || true
5455 cd /var/www/servers.setonix
5556 PORT=${{ secrets.SERVERS_PORT }} pm2 start dist/server/entry.mjs --name setonix-servers --update-env
Original file line number Diff line number Diff line change 1- import type { APIRoute } from ' astro' ;
2- import { loadServersFromConfig } from ' ../scripts/servers/list' ;
1+ import type { APIRoute } from " astro" ;
2+ import { loadServersFromConfig } from " ../scripts/servers/list" ;
33
44export async function GET ( ) {
55 const servers = await loadServersFromConfig ( ) ;
6- return new Response ( JSON . stringify ( { servers} ) , {
6+ return new Response ( JSON . stringify ( { servers } ) , {
77 status : 200 ,
8- headers : { 'Content-Type' : 'application/json' } ,
8+ headers : {
9+ "Content-Type" : "application/json" ,
10+ "Access-Control-Allow-Origin" : "*" ,
11+ } ,
912 } ) ;
10- } ;
13+ }
14+
15+ export const OPTIONS : APIRoute = async ( ) => {
16+ return new Response ( null , {
17+ headers : {
18+ "Access-Control-Allow-Origin" : "*" ,
19+ "Access-Control-Allow-Methods" : "GET" ,
20+ "Access-Control-Allow-Headers" : "Content-Type" ,
21+ "Access-Control-Max-Age" : "21600" , // 6 h cache
22+ } ,
23+ } ) ;
24+ } ;
You can’t perform that action at this time.
0 commit comments