You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sandkasten-web/src/app/services/codeExecution.service.ts

16 lines
437 B

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class CodeExecutionService {
private apiUrl = 'http://localhost:3000'; // Url du serveur Node.js en local
constructor(private http: HttpClient) {}
executeCode(code: string): Observable<any> {
return this.http.post<any>(this.apiUrl, { code });
}
}