我有一个具有ssh root访问权限的生产服务器.我已经安装了go并克隆了我的项目,我正在使用putty运行我的应用程序但是在关闭putty之后我的go应用程序停止工作,我需要做什么才能始终运行应用程序?
这是我的go.service文件
[Unit]
Description=my amazing service
[Service]
Restart=always
RestartSec=3
ExecStart=go run /root/work/src/main/main.go
[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud) 我想从名为“users”的数据库表中获取数据并在表中显示输出。
我写了下面的代码,但它不起作用。
我正在使用 Laravel 5.5
@extends('layouts.app')
@section('content')
<div class="container">
<h2>Admin Panel</h2>
<p>Data of the Registered Users.</p>
<table class="table table-bordered">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
$users = DB::table('users')->select('id','name','email')->get();
@foreach($users as $value)
<tr>
<td>{{ $value->id }}</td>
<td>{{ $value->name }}</td>
<td>{{ $value->email }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
Run Code Online (Sandbox Code Playgroud)
错误:未定义变量:用户