An open API service indexing awesome lists of open source software.

https://github.com/perongh/nextphp

NextPHP is a web framework enabling you to write PHP in JavaScript.
https://github.com/perongh/nextphp

Last synced: about 2 months ago
JSON representation

NextPHP is a web framework enabling you to write PHP in JavaScript.

Awesome Lists containing this project

README

        

# NextPHP

NextPHP is a web framework for people who love PHP so much that they want to write it in JavaScript.

## Features

- PHP-like development experience, but in JavaScript
- Full support for SSR
- Filesystem-based routing
- Can run on Deno Deploy

## How does PHP written in JavaScript look like?

### Form Submission

```ejs

<% if (req.method === 'POST') { %>


<%- await include('../partials/greeting', { name: (await req.formData()).get('name') }) %>


<% } else { %>


Greet

<% } %>

```

### JSON Response

```ejs
<%
res.headers.set('Content-Type', 'application/json')
echo(JSON.stringify(Object.fromEntries(req.headers)))
%>
```

## Usage

Check the `example` folder for a simple example. Basically, all you need to do is `Deno.serve(createHandler(...))`, where `createHandler` can be imported from .