Proyectos
Ver en GitHub
camelaissani/frontexpress
Acerca de
An Express.js-Style router for the front-end
Desarrollo web y de aplicacionesCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalAn Express.js-Style router for the front-end.
Code the front-end like the back-end. Same language same framework.
import frontexpress from 'frontexpress';
// Front-end application
const app = frontexpress();
// handles http 401
app.use((req, res, next) => {
if (res.status === 401) {
window.alert('You are not authenticated! Please sign in.');
} else {
next();
}
});
app.get('/', (req, res) => {
document.querySelector('.content').innerHTML = 'Hello World!';
});
app.post('/login/:user', (req, res) => {
document.querySelector('.content').innerHTML = `Welcome ${req.params.user}!`;
});
// start listening front-end requests (emitted/received)
app.listen();
Features
✔️ You already know ExpressJS then you know FrontExpress
✔️ Simple, minimal core extendable through plugins
✔️ Lighweight framework
✔️ Build your front-end application by handling routes
✔️ Ideal for Single Page Application
✔️ Manage ajax requests and browser history
Installation
From npm repository
$ npm install frontexpress
From bower repository
$ bower install frontexpress
From CDN
On jsDelivr
Documentation
Tests
Clone the repository:
$ git clone [email protected]:camelaissani/frontexpress.git
$ cd frontexpress
Install the dependencies and run the test suite:
$ npm install
$ npm test
License
Explorar proyectos relacionados
Cargando…