Skip to content

Commit

Permalink
🚚 src directory
Browse files Browse the repository at this point in the history
Creates a `src` directory. Prepares for multiple files.
  • Loading branch information
connorjs committed Sep 9, 2023
1 parent 1a02716 commit f356a65
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
26 changes: 0 additions & 26 deletions main.tsp

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0-prerelease",
"type": "module",
"scripts": {
"build": "tsp compile .",
"build": "tsp compile src",
"format": "prettier -l '**/*.{json,md,tsp,yaml}'",
"format:fix": "npm run format -- -w",
"prepare": "is-ci || husky install",
Expand Down
1 change: 1 addition & 0 deletions src/main.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./root.tsp";
26 changes: 26 additions & 0 deletions src/root.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import "@typespec/http";
import "@typespec/rest";

using TypeSpec.Http;
using TypeSpec.Rest;

@service({
title: "SWAPI: The Star Wars API",
version: "v1",
})
@server("https://swapi.dev/api/", "SWAPI server")
namespace SWAPI;

@route("/")
@get
op root(): Root;

// https://swapi.dev/documentation#root
model Root {
films: string;
people: string;
planets: string;
species: string;
starships: string;
vehicles: string;
}

0 comments on commit f356a65

Please sign in to comment.