CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/express-security-basics

Security defaults that belong in every Express application from day one.

93

6.18x
Quality

90%

Does it follow best practices?

Impact

99%

6.18x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-1/

Build a Blog Platform REST API

Problem/Feature Description

A content team needs a REST API for their blogging platform. The API is built with Express and TypeScript. A Next.js frontend hosted on a different domain will consume it. The API will eventually run on a cloud VM behind a load balancer.

The API needs the following endpoints:

  • GET /api/posts -- list all published posts (supports ?page=1&sort=date query parameters)
  • GET /api/posts/:slug -- get a single post by its URL slug
  • POST /api/posts -- create a new blog post (accepts title, content, tags array)
  • PATCH /api/posts/:slug -- update an existing post
  • DELETE /api/posts/:slug -- delete a post
  • POST /api/posts/:slug/comments -- add a comment to a post (accepts author and body)

Use an in-memory array as the data store. Posts should have id, title, slug, content, tags, comments, published, and createdAt fields. Generate slugs from titles.

Output Specification

Produce:

  • app.ts -- Express application with all middleware and route setup
  • routes/posts.ts -- Router module with the blog post CRUD handlers
  • package.json -- With all required dependencies

evals

scenario-1

criteria.json

task.md

tile.json