Skip to content

Instantly share code, notes, and snippets.

View medeirosjoaquim's full-sized avatar
🎯
Focusing

Joaquim medeirosjoaquim

🎯
Focusing
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@medeirosjoaquim
medeirosjoaquim / Request.ts
Created March 27, 2019 12:35 — forked from azarus/Request.ts
SIMPLE AND EASY HTTP REQUESTS IN ANGULAR2! GET A PROMISE AND USE IT EASILY!
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { Config } from '../Config';
import { Observable } from 'rxjs/Observable';
import 'rxjs/Rx';
@Injectable()
export class Request {
constructor(public http: Http)
@medeirosjoaquim
medeirosjoaquim / server.js
Created March 5, 2019 19:55 — forked from ryanoglesby08/server.js
A node.js SPA server that serves static files and an index.html file for all other routes.
/*
Incredibly simple Node.js and Express application server for serving static assets.
Given as an example from the React Router documentation (along with examples
using nginx and Apache):
- https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md#browserhistory
*/
const express = require('express');
const path = require('path');
@medeirosjoaquim
medeirosjoaquim / server.js
Created March 5, 2019 19:55 — forked from giacomorebonato/server.js
simple ExpressJS spa
const express = require('express')
const bodyParser = require('body-parser')
const path = require('path')
const app = express()
// assets. Static JS, CSS, fonts
app.use('/public', express.static(path.join(__dirname, '../public')))
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.