main.js 925 Bytes
var express = require('express')
var app = express()
var fs = require('fs');
// var path = require('path');
// var qs = require('querystring');
// var sanitizeHtml = require('sanitize-html');
var template = require('./lib/template.js');

app.use(express.static('data'));
app.get('/', function(request, response) { 
    fs.readFile('./contents/main', function(error, body){
      var title = 'Health Care';
      var ch='15ch'
      var html = template.HTML(title,ch,'',body); 
      response.send(html);
    });
  });

  app.get('/signup', function(request, response) { 
    fs.readFile('./contents/signup', function(error, body){
      var title = 'Sign Up Page';
      var ch='5ch'
      var html = template.HTML(title,ch,`<link rel="stylesheet" type="text/css" href="./a.css" />`,body); 
      response.send(html);
    });
  });

  app.listen(3000, function() {
    console.log('Example app listening on port 3000!')
  });