A Node.js web application that fetches a URL, replaces every instance of "Yale" with "Fale" in the document, and displays the modified content.
- Simple and intuitive user interface
- Fetches web content from any URL
- Replaces all instances of "Yale" with "Fale" (case-insensitive)
- Displays the modified content in an iframe
- Shows original URL and page title in an info bar
- Clone this repository
- Navigate to the project directory
- Install dependencies:
npm install
- Start the server:
npm start
- Open a browser and go to
http://localhost:3001
- Enter a URL in the input field (e.g., https://www.yale.edu)
- Click "Fetch & Replace" to see the modified content
To run with auto-restart on file changes:
npm run dev
The application includes a comprehensive test suite:
- Unit tests: Test the Yale-to-Fale replacement logic
- API tests: Test the application endpoints
- Integration tests: Test the entire application workflow
# Run all tests
npm test
# Run tests in watch mode during development
npm run test:watch
# Run tests with coverage for CI/CD
npm run test:ci
The repository includes a GitHub Actions workflow configuration in .github/workflows/ci.yml
that:
- Runs on pushes to main/master branches and on pull requests
- Tests the application on multiple Node.js versions (18.x, 20.x)
- Generates and uploads test coverage reports
- Automatically deploys to Vercel (when pushing to main/master)
To enable automatic deployments to Vercel, you need to:
- Create a Vercel account and link your repository
- Create a Vercel project for your application
- Generate a Vercel token and add it as a secret in your GitHub repository:
- Go to Settings → Secrets → Actions
- Add a new secret named
VERCEL_TOKEN
with your Vercel token
- Node.js
- Express - Web server framework
- Axios - HTTP client for fetching web pages
- Cheerio - HTML parsing and manipulation
- Vanilla JavaScript for frontend functionality
- Jest, Supertest, and Nock for testing