Lumen custom page-notfound response

Lumen custom page-notfound response

Notice: This article is only a available in Chinese version available. :( 在 App\Exceptions\Handler 中引入: use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 然后在render()中更改响应的方式。 如果要渲染成页面,可以先在view文件夹中添加error.blade.php文件,然后在render()中return前加入判断404的语句: if ($e instanceof NotFoundHttpException){ return response(view("error"),404); } …

Continue Reading >>

Dream review on 23rd December

Dream review on 23rd December

Notice: This article is only available in Chinese. :( 刚醒来的时候,发现自己身处一狭窄的房间中。四周的地板边缘发出暗淡的深蓝色的光;面前有只有几步的小台阶,直连一截狭隘的走廊;走廊右侧便有一更小的房间,其中有着更加黯淡的深蓝色光芒。回想着不久之前发生的一切:天空突然的阴晦,喷气背包燃料的耗尽 … 是些什么记忆,如同梦境一般。 黑夜里的航海人突然从岸上醒来般的震惊使我坐了起来。我用手支撑着自己,同时听到了小房间里的金属碰撞的声音。 “Who is …

Continue Reading >>

Mudmood Gallery

Mudmood Gallery

Not only is this page a tunes' list, but also a gallery to match music with vivid artistic photos or paitings. Just come up with an idea, and this project (if could be called so) is still in process. List kept updating. Every item comes with a link to the source of the tune and a photo or paiting from Unsplash, Pexels or others, used under …

Continue Reading >>

NGINX 开放跨站请求

在Twic lab中新添加了一个CDN项目T HREF,将常见的字体、前端框架等静态文件统一放在里面,便于引用。 然而在实际应用时,发现能够直接访问文件,能够在同一域下的其他文件中调用,却不能够在其他域中调用。 解决方法: 在CDN项目的NGINX配置文件中添加响应头: add_header Access-Control-Allow-Origin *; 以开放跨站请求,即可解决问题。

Continue Reading >>

Ubuntu 16.04 升级至 17.10

虽然部分VPS商家如Vultr等在部署时均提供Ubuntu 17.10版本,大多数的提供商(至少我遇到的两三家)的Ubuntu版本都还是在16.10及以下。为了方便使用,当然想把我的所有VPS都弄成同一个操作系统统一版本;既然决定使用Ubuntu 17.10,那么剩下的如何更新呢? 若是Ubuntu17.04,只需 " apt update " 后执行 " do-release-upgrade " 。但是对于以下的版本 (<= 16.10) ,似乎需要折腾一会儿。 更新已安装包 还是照常, apt update 如果有更新,就 apt upgrade 安装并配置更新管理 apt dist-upgrade apt install update-manager-core 安装好后打开 " …

Continue Reading >>