Skip to content
Snippets Groups Projects
Commit 435a7d14 authored by Will Billingsley's avatar Will Billingsley
Browse files

Added basic server with hello world route

parent eb10da28
No related branches found
No related tags found
No related merge requests found
export * from './welcome.controller';
\ No newline at end of file
import { Request, Response } from 'express';
/**
* A controller action for our home page, just with plain text
* @param res
* @param resp
*/
export let index = (res:Request, resp:Response) => {
resp.send("Hello world, it's express here!")
}
\ No newline at end of file
import express from 'express';
import * as welcome from "./controllers/welcome.controller"
const app = express()
const port: string = process.env.PORT || "3000"
/*
* Routes
*/
app.get('/', welcome.index)
/*
* Start the server
*/
const server = app.listen(port, () => {
console.log("App running on port %d", port);
});
export default app
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment