Code Monkey home page Code Monkey logo

static-md-nodejs's Introduction

Coding sprint.

This is a static file app that renders HTML from markdown.

Libraries used for this project are: Showdown, Express, fs. for dev/testing I am using Jest + Supertest with Nodemon.

Instructions.

To run, simply ensure node and npm is installed. with npm i and use npm run devStart in order to run the server in with nodemon.

Testing.

As per the spec, there are three tests in the __tests__ folder.

tests can be completed by first ensuring the required libraries are installed (running npm i in the project directory.)

You can then run npm run test to execute Jest.

  • Test 1: Checks for statuscode 200. It generates a random valid file to GET.

  • Test 2: Checks for status code 404. It generates a random string to GET. (hopefully it is invalid ;)

  • Test 3: Parses a uses the random md selected by the helper, converts the md to HTML using showdown, and compares it against the output. (it attempts to GET the appropriate URL.)

Hosted versions

I will host on Heroku, it is available for online testing. Click Here to Access

URL: https://statmd.netlify.app/

Other Notes.

I did consider using a rendering engine such as Handlebars.js. but as the project is quite small, I chose not to.

static-md-nodejs's People

Contributors

ameeno avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.