Last active
August 29, 2015 14:10
-
-
Save pipeflo/ef54759d09dd18e2c764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies. | |
*/ | |
var express = require('express'); | |
var routes = require('./routes'); | |
var http = require('http'); | |
var path = require('path'); | |
var i18n = require('./i18n'); | |
//load customers route | |
var customers = require('./routes/customers'); | |
var app = express(); | |
app.use(i18n); | |
var connection = require('express-myconnection'); | |
var mysql = require('mysql'); | |
// all environments | |
app.set('port', process.env.PORT || 4300); | |
app.set('views', path.join(__dirname, 'views')); | |
app.set('view engine', 'ejs'); | |
//app.use(express.favicon()); | |
app.use(express.logger('dev')); | |
app.use(express.json()); | |
app.use(express.urlencoded()); | |
app.use(express.methodOverride()); | |
app.use(express.static(path.join(__dirname, 'public'))); | |
// development only | |
if ('development' == app.get('env')) { | |
app.use(express.errorHandler()); | |
} | |
/*------------------------------------------ | |
connection peer, register as middleware | |
type koneksi : single,pool and request | |
-------------------------------------------*/ | |
app.use( | |
connection(mysql,{ | |
host: '127.0.0.1', | |
user: 'root', | |
password : '', | |
port : 3306, //port mysql | |
database:'tutorial' | |
},'pool') //or single | |
); | |
app.get('/index', routes.index); | |
app.get('/customers', customers.list); | |
app.get('/customers/add', customers.add); | |
app.post('/customers/add', customers.save); | |
app.get('/customers/delete/:id', customers.delete_customer); | |
app.get('/customers/edit/:id', customers.edit); | |
app.post('/customers/edit/:id',customers.save_edit); | |
app.use(app.router); | |
http.createServer(app).listen(app.get('port'), function(){ | |
console.log('Express server listening on port ' + app.get('port')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"SignIn": "Sign In", | |
"Equipo": "Equipo", | |
"Contacto": "Contacto", | |
"Nombre": "Nombre", | |
"Bienvenido": "Bienvenido", | |
"Inicie": "Inicie", | |
"Por Favor Inicie Sesión": "Por Favor Inicie Sesión", | |
"Password": "Password", | |
"Recordarme": "Recordarme", | |
"Iniciar Sesion": "Iniciar Sesión", | |
"Nuestro Equipo": "Nuestro Equipo", | |
"Descripcion Equipo": "Descripcion Equipo", | |
"Visite nuestra comunidad": "Visite nuestra comunidad", | |
"Contactanos": "Contactanos", | |
"Mas Informacion": "Mas Informacion", | |
"MailTo": "MailTo" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title><%=(locals.title) ? title :''%></title> | |
<!-- Bootstrap Core CSS --> | |
<link href="css/bootstrap.min.css" rel="stylesheet"> | |
<!-- Custom CSS --> | |
<link href="css/grayscale.css" rel="stylesheet"> | |
<!-- Custom Fonts --> | |
<link href="font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> | |
<link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css"> | |
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> | |
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> | |
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> | |
<!--[if lt IE 9]> | |
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> | |
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> | |
<![endif]--> | |
</head> | |
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top"> | |
<!-- Navigation --> | |
<nav class="navbar navbar-custom navbar-fixed-top" role="navigation"> | |
<div class="container"> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse"> | |
<i class="fa fa-bars"></i> | |
</button> | |
<a class="navbar-brand page-scroll" href="#page-top"> | |
<i class="fa fa-play-circle"></i> <span class="light"> IBM | </span>SW Help</a> | |
</div> | |
<!-- Collect the nav links, forms, and other content for toggling --> | |
<div class="collapse navbar-collapse navbar-right navbar-main-collapse"> | |
<ul class="nav navbar-nav"> | |
<!-- Hidden li included to remove active class from about link when scrolled up past about section --> | |
<li class="hidden"> | |
<a href="#page-top"></a> | |
</li> | |
<li> | |
<a class="page-scroll" href="#about"><%= __('SignIn')%></a> | |
</li> | |
<li> | |
<a class="page-scroll" href="#download"><%= __('Equipo')%></a> | |
</li> | |
<li> | |
<a class="page-scroll" href="#contact"><%= __('Contacto')%></a> | |
</li> | |
</ul> | |
</div> | |
<!-- /.navbar-collapse --> | |
</div> | |
<!-- /.container --> | |
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%- include layouts/header.ejs %> | |
<!-- Intro Header --> | |
<header class="intro"> | |
<div class="intro-body"> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-8 col-md-offset-2"> | |
<h1 class="brand-heading"><%= __('Nombre')%></h1> | |
<p class="intro-text"><%= __('Bienvenido')%><br><%= __('Inicie')%></p> | |
<a href="#about" class="btn btn-circle page-scroll"> | |
<i class="fa fa-angle-double-down animated"></i> | |
</a> | |
</div> | |
</div> | |
</div> | |
</div> | |
</header> | |
<!-- About Section --> | |
<section id="about" class="container content-section text-center"> | |
<div class="row"> | |
<div class="container"> | |
<form class="form-signin" role="form"> | |
<h2 class="form-signin-heading"><%= __('Por Favor Inicie Sesion')%></h2> | |
<label for="inputEmail" class="sr-only">Usuario</label> | |
<input type="email" id="inputEmail" class="form-control" placeholder="E-mail" required autofocus> | |
<label for="inputPassword" class="sr-only">Contraseña</label> | |
<input type="password" id="inputPassword" class="form-control" placeholder="<%= __('Password')%>" required> | |
<div class="checkbox"> | |
<label> | |
<input type="checkbox" value="remember-me"> <%= __('Recordarme')%> | |
</label> | |
</div> | |
<button class="btn btn-lg btn-primary btn-block" type="submit"><%= __('Iniciar Sesion')%></button> | |
</form> | |
</div> | |
</div> | |
</section> | |
<!-- Download Section --> | |
<section id="download" class="content-section text-center"> | |
<div class="download-section"> | |
<div class="container"> | |
<div class="col-lg-8 col-lg-offset-2"> | |
<h2><%= __('Nuestro Equipo')%></h2> | |
<p><%= __('Descripcion Equipo')%></p> | |
<a href="https://apps.na.collabserv.com/communities/service/html/communityview?communityUuid=9436b386-2fd7-453d-b49c-08e5ebd0abf5" class="btn btn-default btn-lg"><%= __('Visite nuestra comunidad')%></a> | |
</div> | |
</div> | |
</div> | |
</section> | |
<!-- Contact Section --> | |
<section id="contact" class="container content-section text-center"> | |
<div class="row"> | |
<div class="col-lg-8 col-lg-offset-2"> | |
<h2><%= __('Contactanos')%></h2> | |
<p><%= __('Mas Informacion')%></p> | |
<p><a href="mailto:swhelp@co.ibm.com"><%= __('MailTo')%></a> | |
</p> | |
<ul class="list-inline banner-social-buttons"> | |
<li> | |
<a href="https://twitter.com/" class="btn btn-default btn-lg"><i class="fa fa-twitter fa-fw"></i> <span class="network-name">Twitter</span></a> | |
</li> | |
<li> | |
<a href="https://github.com/" class="btn btn-default btn-lg"><i class="fa fa-github fa-fw"></i> <span class="network-name">Github</span></a> | |
</li> | |
<li> | |
<a href="https://www.linkedin.com" class="btn btn-default btn-lg"><i class="fa fa-linkedin fa-fw"></i> <span class="network-name">LinkedIn</span></a> | |
</li> | |
</ul> | |
</div> | |
</div> | |
</section> | |
<%- include layouts/footer.ejs %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.index = function(req, res){ | |
res.render('index', { title: 'LA Software Sales Help' }); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"SignIn": "Sign In", | |
"Equipo": "Time", | |
"Contacto": "Contato", | |
"Nombre": "LA SW Sales Help", | |
"Bienvenido": "Seja Bemvindo ao nossa plataforma de contato.", | |
"Inicie": "Faza o login para criar um chamado.", | |
"Por Favor Inicie Sesion": "Por Favor Inicie Sesão", | |
"Password": "Password", | |
"Recordarme": "Recordarme", | |
"Iniciar Sesion": "Iniciar Sesion", | |
"Nuestro Equipo": "Nuestro Equipo", | |
"Descripcion Equipo": "Descripcion Equipo", | |
"Visite nuestra comunidad": "Visite nuestra comunidad", | |
"Contactanos": "Contactanos", | |
"Mas Informacion": "Mas Informacion", | |
"MailTo": "MailTo" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment