<?php

use App\Http\Controllers\API\AuthApiController;
use App\Http\Controllers\DeviceController;
use App\Http\Controllers\HomeController;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::get('/device/status', [DeviceController::class, 'getStatus']);
Route::post('/device/data', [DeviceController::class, 'storeSensorData']);
Route::post('/device/lamp', [DeviceController::class, 'storeLamp']);

Route::fallback(function () {
    return response()->json([
        'errors' => 'Endpoint tidak ditemukan'
    ], 404);
});
