lautiamkok / nuxt-slim

Using Nuxt to decouple the view and controller in a PHP application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nuxt + Slim

A basic concept using Nuxt and Slim to decouple controllers and views in a PHP application.

Read the post here about this repository.

Nuxt Setup

# Dependencies
$ npm install

# Production
$ npm start

Then, access it at http://localhost:3000/

Slim Setup

# Dependencies
$ composer update

# Production
$ cd [my-app-name]
$ php -S 0.0.0.0:8181 -t public

Then, access it at http://localhost:8181/

Dependencies

  1. Node
  1. PHP

Notes

  1. Using this approach, you must run two apps concurrently on different ports.

  2. Operation timed out (IPv6 issues). On linux, it seems that running this command helps to make ipv4 traffic have a higher prio than ipv6, which is a better alternative than disabling ipv6 entirely:

$ sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"

About

Using Nuxt to decouple the view and controller in a PHP application.


Languages

Language:PHP 52.4%Language:Vue 36.3%Language:JavaScript 7.6%Language:CSS 3.7%